C++: Use new getConvSpecString instead of getConvSpecOffset and substring#21702
Draft
jketema wants to merge 1 commit intogithub:mainfrom
Draft
C++: Use new getConvSpecString instead of getConvSpecOffset and substring#21702jketema wants to merge 1 commit intogithub:mainfrom
getConvSpecString instead of getConvSpecOffset and substring#21702jketema wants to merge 1 commit intogithub:mainfrom
Conversation
getConvSpecString instead of getConvSpecOffset and substringgetConvSpecString instead of getConvSpecOffset and substring
geoffw0
reviewed
Apr 13, 2026
| * Gets the nth conversion specifier string. | ||
| */ | ||
| private string getConvSpecString(int n) { | ||
| n >= 0 and result = "%" + this.getFormat().splitAt("%", n + 1) |
Contributor
There was a problem hiding this comment.
I like this, it's quite clean for what it accomplishes. 👍
| fmt = this.getFormat() and | ||
| rst = fmt.substring(offset, fmt.length()) and | ||
| exists(string rst, string regexp | | ||
| rst = this.getConvSpecString(n) and |
Contributor
There was a problem hiding this comment.
rst is an odd choice of name now, since it used to (presumably) mean "rest", as in "the rest of the string after this conversion specifier". Now it means "the string from this conversion specifier to the next" and I think it should be renamed to reflect that.
Contributor
Author
There was a problem hiding this comment.
I read it as result, but you might be right.
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.
Should address
glibctimeout in BMN DCA.Two DCA experiments:
Please ignore the Custom Sources DCA experiment(s).