Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(752)

Side by Side Diff: Source/core/inspector/ContentSearchUtils.cpp

Issue 482753002: Use StringBuilder::appendLiteral() / StringBuilder::append(char) when possible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 10 *
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 static const char regexSpecialCharacters[] = "[](){}+-*.,?\\^$|"; 42 static const char regexSpecialCharacters[] = "[](){}+-*.,?\\^$|";
43 } 43 }
44 44
45 static String createSearchRegexSource(const String& text) 45 static String createSearchRegexSource(const String& text)
46 { 46 {
47 StringBuilder result; 47 StringBuilder result;
48 String specials(regexSpecialCharacters); 48 String specials(regexSpecialCharacters);
49 49
50 for (unsigned i = 0; i < text.length(); i++) { 50 for (unsigned i = 0; i < text.length(); i++) {
51 if (specials.find(text[i]) != kNotFound) 51 if (specials.find(text[i]) != kNotFound)
52 result.append("\\"); 52 result.append('\\');
53 result.append(text[i]); 53 result.append(text[i]);
54 } 54 }
55 55
56 return result.toString(); 56 return result.toString();
57 } 57 }
58 58
59 static Vector<pair<int, String> > getScriptRegexpMatchesByLines(const ScriptRege xp* regex, const String& text) 59 static Vector<pair<int, String> > getScriptRegexpMatchesByLines(const ScriptRege xp* regex, const String& text)
60 { 60 {
61 Vector<pair<int, String> > result; 61 Vector<pair<int, String> > result;
62 if (text.isEmpty()) 62 if (text.isEmpty())
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 } 179 }
180 180
181 String findSourceMapURL(const String& content, MagicCommentType commentType, boo l* deprecated) 181 String findSourceMapURL(const String& content, MagicCommentType commentType, boo l* deprecated)
182 { 182 {
183 return findMagicComment(content, "sourceMappingURL", commentType, deprecated ); 183 return findMagicComment(content, "sourceMappingURL", commentType, deprecated );
184 } 184 }
185 185
186 } // namespace ContentSearchUtils 186 } // namespace ContentSearchUtils
187 } // namespace blink 187 } // namespace blink
188 188
OLDNEW
« no previous file with comments | « Source/core/html/track/vtt/VTTParser.cpp ('k') | Source/core/inspector/InspectorApplicationCacheAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698