Commit 225f08bf by Jamie Madill Committed by Commit Bot

Cleanups to StripArrayIndices.

Not picked up in prior review. Bug: angleproject:3024 Change-Id: I9dd1ea146996c8ac3569070af0cb12df65f0d815 Reviewed-on: https://chromium-review.googlesource.com/c/1394570Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 1f56ed2a
...@@ -155,9 +155,9 @@ std::string StripArrayIndices(const std::string &nameIn) ...@@ -155,9 +155,9 @@ std::string StripArrayIndices(const std::string &nameIn)
while (pos != std::string::npos) while (pos != std::string::npos)
{ {
size_t closePos = name.find(']', pos); size_t closePos = name.find(']', pos);
ASSERT(closePos != std::string::npos && closePos > pos); ASSERT(closePos != std::string::npos);
name.erase(pos, closePos - pos + 1); name.erase(pos, closePos - pos + 1);
pos = name.find('['); pos = name.find('[', pos);
} }
ASSERT(name.find(']') == std::string::npos); ASSERT(name.find(']') == std::string::npos);
return name; return name;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment