| Index: net/base/lookup_string_in_fixed_set_unittest.cc
|
| diff --git a/net/base/lookup_string_in_fixed_set_unittest.cc b/net/base/lookup_string_in_fixed_set_unittest.cc
|
| index a97b031141d929fb5148ef7ca580ff119c14b3c3..7a6bc98dc3b791591bcb6839b4042b5579d2f30b 100644
|
| --- a/net/base/lookup_string_in_fixed_set_unittest.cc
|
| +++ b/net/base/lookup_string_in_fixed_set_unittest.cc
|
| @@ -4,8 +4,6 @@
|
|
|
| #include "net/base/lookup_string_in_fixed_set.h"
|
|
|
| -#include <string.h>
|
| -
|
| #include <algorithm>
|
| #include <limits>
|
| #include <ostream>
|
| @@ -16,6 +14,7 @@
|
| #include "base/files/file_path.h"
|
| #include "base/files/file_util.h"
|
| #include "base/path_service.h"
|
| +#include "base/strings/string_piece.h"
|
| #include "base/strings/string_util.h"
|
| #include "base/strings/stringprintf.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| @@ -53,8 +52,9 @@ void PrintTo(const Expectation& expectation, std::ostream* os) {
|
| class LookupStringInFixedSetTest : public testing::TestWithParam<Expectation> {
|
| protected:
|
| template <size_t N>
|
| - int LookupInGraph(const unsigned char(&graph)[N], const char* key) {
|
| - return LookupStringInFixedSet(graph, N, key, strlen(key));
|
| + int LookupInGraph(const unsigned char (&graph)[N], base::StringPiece key) {
|
| + std::string rev_key(key.rbegin(), key.rend());
|
| + return LookupStringInFixedSet(graph, N, rev_key.data(), rev_key.length());
|
| }
|
| };
|
|
|
| @@ -77,7 +77,7 @@ void RecursivelyEnumerateDafsaLanguage(
|
| std::vector<std::pair<std::string, int>>* language) {
|
| int result = lookup.GetResultForCurrentSequence();
|
| if (result != kDafsaNotFound) {
|
| - language->emplace_back(std::string(sequence->begin(), sequence->end()),
|
| + language->emplace_back(std::string(sequence->rbegin(), sequence->rend()),
|
| result);
|
| }
|
| // Try appending each char value.
|
|
|