isapir commented on code in PR #751:
URL: https://github.com/apache/tomcat/pull/751#discussion_r1756107715
##########
java/org/apache/tomcat/util/http/FastHttpDateFormat.java:
##########
@@ -105,7 +105,7 @@ public final class FastHttpDateFormat {
public static String getCurrentDate() {
long now = System.currentTimeMillis();
// Handle case where time moves backwards (e.g. system time corrected)
- if (Math.abs(now - currentDateGenerated) > 1000) {
+ if (now - now%1000L != currentDateGenerated -
currentDateGenerated%1000L) {
Review Comment:
@Chenjp If it's a few nanoseconds then that's fine by me. How did you
measure that? Using JMH?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]