Commit 3a3a7dac authored by Dan McArdle's avatar Dan McArdle Committed by Chromium LUCI CQ

Per style guide, avoid variable-length array in RobotsRulesParser.

Change-Id: I34aefab0097426efd47a07062e5a448530c66a06
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2626510
Commit-Queue: Dan McArdle <dmcardle@chromium.org>
Reviewed-by: default avatarrajendrant <rajendrant@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845684}
parent b1371c8b
......@@ -30,7 +30,7 @@ bool IsMatchingRobotsRule(const std::string& path, const std::string& pattern) {
}
size_t numpos = 1;
size_t pos[path.length() + 1];
std::vector<size_t> pos(path.length() + 1, 0);
// The pos[] array holds a sorted list of indexes of 'path', with length
// 'numpos'. At the start and end of each iteration of the main loop below,
......@@ -39,7 +39,6 @@ bool IsMatchingRobotsRule(const std::string& path, const std::string& pattern) {
// return false. If we reach the end of 'pattern' with at least one element
// in pos[], return true.
pos[0] = 0;
for (auto pat = pattern.begin(); pat != pattern.end(); ++pat) {
if (*pat == '$' && pat + 1 == pattern.end()) {
return (pos[numpos - 1] == path.length());
......
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