Repository navigation
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
🟡 Changes recommended
The new lookup logic accepts malformed weekday and month names.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Optimizes HTTP date parsing by replacing weekday and month lookup loops with direct character dispatch.
Changes:
- Adds constant-time weekday and month matching.
- Adds coverage for an alternate date-field ordering.
File summaries
| File | Description |
|---|---|
lib/parsedate.c |
Implements direct name lookups. |
tests/libtest/lib517.c |
Adds a date parsing case. |
Review details
Suppressed comments (4)
lib/parsedate.c:268
- The equality test is passed into
LOWERCASE, making this operand always nonzero. Consequently, any three-letter token starting withFeis incorrectly accepted as February.
if((LOWERCASE(check[1]) == 'e') && LOWERCASE(check[2] == 'b'))
lib/parsedate.c:292
- The equality test is passed into
LOWERCASE, making this operand always nonzero. Consequently, any three-letter token starting withNois incorrectly accepted as November.
if((LOWERCASE(check[1]) == 'o') && LOWERCASE(check[2] == 'v'))
lib/parsedate.c:296
- The equality test is passed into
LOWERCASE, making this operand always nonzero. Consequently, any three-letter token starting withOcis incorrectly accepted as October.
if((LOWERCASE(check[1]) == 'c') && LOWERCASE(check[2] == 't'))
lib/parsedate.c:300
- The equality test is passed into
LOWERCASE, making this operand always nonzero. Consequently, any three-letter token starting withSeis incorrectly accepted as September.
if((LOWERCASE(check[1]) == 'e') && LOWERCASE(check[2] == 'p'))
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
bagder
force-pushed
the
bagder/datename-scans
branch
from
September 17, 2026 12:42
534e4ce to
3c83eb9
Compare
qhill
reviewed
Sep 17, 2026
Implements faster lookups for which specific week name and month name that is provided; without loops. With this applied, the dateparser perf test completes almost twice as fast for me. Add unit test 4781 to verify each parser.
bagder
force-pushed
the
bagder/datename-scans
branch
from
September 17, 2026 14:18
7ca06ff to
c20b20a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements faster lookups for which specific week name and month name that is provided; without loops.
With this applied, the dateparser perf test completes almost twice as fast for me.