Index: src/scanner.cc |
diff --git a/src/scanner.cc b/src/scanner.cc |
index a2ca30a9be5df0b08eede51835eb506ff78752a1..55a3ab181ad01eb12a8c697d4da24d1bcd90444a 100644 |
--- a/src/scanner.cc |
+++ b/src/scanner.cc |
@@ -1433,6 +1433,17 @@ double Scanner::DoubleValue() { |
} |
+bool Scanner::ContainsDot() { |
Sven Panne
2015/06/22 07:53:43
Instead of using caveman-style loops, the right wa
bradn
2015/06/23 06:54:07
Turns out Vector<> provides begin/end, which allow
|
+ DCHECK(is_literal_one_byte()); |
+ Vector<const uint8_t> literal_string = literal_one_byte_string(); |
titzer
2015/06/22 07:08:16
Does this make a copy of the bytes underneath?
bradn
2015/06/23 06:54:07
No, it copies a reference to the underying buffer
|
+ bool with_dot = false; |
+ for (int i = 0; !with_dot && i < literal_string.length(); ++i) { |
+ with_dot |= (literal_string[i] == '.'); |
titzer
2015/06/22 07:08:16
Early return?
bradn
2015/06/23 06:54:07
Replaced.
FWIW was lifted wholesale from a prototy
|
+ } |
+ return with_dot; |
+} |
+ |
+ |
int Scanner::FindSymbol(DuplicateFinder* finder, int value) { |
if (is_literal_one_byte()) { |
return finder->AddOneByteSymbol(literal_one_byte_string(), value); |