-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Keep AutoString::length in sync w/ AutoString::data #3588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| return errorCode; | ||
| } | ||
|
|
||
| size_t GetLength() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AutoString::GetLength is used only in Debugger.cpp (namely, https://github.com/Microsoft/ChakraCore/blob/master/bin/ch/Debugger.cpp#L497). If ChakraFull doesn't have any additional dependencies we could do away with AutoString::GetLength
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Cellule what do you think?
|
This supposed to cache string length so we don't measure it again and again.. Well, this is not perf critical part of the solution. LGTM. Yet, could we do it while caching the |
|
@obastemur I pondered a bit on the caching aspect. Unfortunately, this design created enough complexity to produce a bug. Moreover, some uses in Anyways, I'll do whatever you guys tell me to. fyi @arunetm |
|
@Krovatkin First of all it won't affect ChakraFull since this file is in ch.exe only I found the source of the bug. I think we have to use Thoughts ? |
a97a501 to
d64b4ce
Compare
|
@Cellule, done |
|
@dotnet-bot test Ubuntu static_ubuntu_linux_release please |
|
Thanks @Krovatkin, I will merge it for you |
…g::data Merge pull request #3588 from Krovatkin:autostr_len_fix This fix makes sure that `AutoString::length` and `AutoString::data` are in sync.
|
@Cellule thank you for your help! |
This fix makes sure that
AutoString::lengthandAutoString::dataare in sync.