Skip to content

UnboundList: More compact string representation - #22606

Open
hvitved wants to merge 2 commits into
github:mainfrom
hvitved:unbound-list-unicode-encoding
Open

hvitved wants to merge 2 commits into
github:mainfrom
hvitved:unbound-list-unicode-encoding

Conversation

@hvitved

@hvitved hvitved commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

A small change to use ASCII base encoding instead of base 10; I also tried Unicode encoding (first commit), but that didn't work (presumably because they do not work with the various regex operations). I recommend reviewing the two commits combined.

DCA is uneventful.

@hvitved
hvitved force-pushed the unbound-list-unicode-encoding branch from 5f786b9 to 73bae65 Compare September 17, 2026 13:14
@hvitved hvitved changed the title UnboundList: More compact string representation using Unicode UnboundList: More compact string representation Sep 17, 2026
@hvitved
hvitved force-pushed the unbound-list-unicode-encoding branch from 3034640 to 39850bc Compare September 17, 2026 15:11
@hvitved
hvitved force-pushed the unbound-list-unicode-encoding branch from 39850bc to 449e377 Compare September 17, 2026 15:36
@hvitved hvitved added the no-change-note-required This PR does not need a change note label Sep 17, 2026
@hvitved
hvitved marked this pull request as ready for review September 17, 2026 17:56
@hvitved
hvitved requested a review from a team as a code owner September 17, 2026 17:56
Copilot AI balanced review requested due to automatic review settings September 17, 2026 17:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The encoding emits a redundant zero digit for every element, undermining the intended compactness.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Replaces decimal element IDs with compact printable ASCII encoding in UnboundList.

Changes:

  • Adds base-94 encoding excluding the . separator.
  • Generalizes list regex operations to support nonnumeric encodings.
File Description
shared/​util/​codeql/​util/​UnboundList.qll Implements ASCII encoding and updates parsing regexes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +72 to +76
exists(int mid |
mid = getAsciiCodePart(e, i - 1) and
mid > 0 and
result = mid / asciiCodes()
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-change-note-required This PR does not need a change note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants