[PR #344] [MERGED] Eliminate unnecessary use of GregorianCalendar #514

Closed
opened 2025-12-30 01:25:03 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/apple/pkl/pull/344
Author: @odenix
Created: 3/20/2024
Status: Merged
Merged: 3/21/2024
Merged by: @bioball

Base: mainHead: calendar


📝 Commits (1)

  • fbfc3d1 Eliminate unnecessary use of GregorianCalendar

📊 Changes

1 file changed (+8 additions, -7 deletions)

View changed files

📝 pkl-core/src/main/java/org/pkl/core/project/ProjectPackager.java (+8 -7)

📄 Description

It's unnecessary to load and instantiate an expensive Calendar class to compute this constant.

jshell> new GregorianCalendar(1980, Calendar.FEBRUARY, 1, 0, 0, 0).getTimeInMillis();
$1 ==> 318240000000


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/apple/pkl/pull/344 **Author:** [@odenix](https://github.com/odenix) **Created:** 3/20/2024 **Status:** ✅ Merged **Merged:** 3/21/2024 **Merged by:** [@bioball](https://github.com/bioball) **Base:** `main` ← **Head:** `calendar` --- ### 📝 Commits (1) - [`fbfc3d1`](https://github.com/apple/pkl/commit/fbfc3d12829d37e0637f5712f15a9e19c9559e2a) Eliminate unnecessary use of GregorianCalendar ### 📊 Changes **1 file changed** (+8 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `pkl-core/src/main/java/org/pkl/core/project/ProjectPackager.java` (+8 -7) </details> ### 📄 Description It's unnecessary to load and instantiate an expensive Calendar class to compute this constant. jshell> new GregorianCalendar(1980, Calendar.FEBRUARY, 1, 0, 0, 0).getTimeInMillis(); $1 ==> 318240000000 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 01:25:03 +01:00
adam closed this issue 2025-12-30 01:25:04 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#514