Skip to content

Commit

Permalink
Make CSSSyntaxDescriptor constructor explicit and not bump string ref…
Browse files Browse the repository at this point in the history
… count.

It's not clear that much is gained by passing by value here (the inner functions
use const references), and in any event, single-argument constructors should
be explicit unless it's intended that they be used for implicit conversion.

Change-Id: I0e4d0824dadfd8ef4de1ea513bf48059612ac53a
Reviewed-on: https://chromium-review.googlesource.com/655858
Reviewed-by: meade_UTC10 <meade@chromium.org>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501132}
  • Loading branch information
jeremyroman authored and Commit Bot committed Sep 12, 2017
1 parent efddaef commit 58ee710
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion third_party/WebKit/Source/core/css/CSSSyntaxDescriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ bool ConsumeSyntaxIdent(const String& input, size_t& offset, String& ident) {
return !CSSPropertyParserHelpers::IsCSSWideKeyword(ident);
}

CSSSyntaxDescriptor::CSSSyntaxDescriptor(String input) {
CSSSyntaxDescriptor::CSSSyntaxDescriptor(const String& input) {
size_t offset = 0;
ConsumeWhitespace(input, offset);

Expand Down
2 changes: 1 addition & 1 deletion third_party/WebKit/Source/core/css/CSSSyntaxDescriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct CSSSyntaxComponent {

class CORE_EXPORT CSSSyntaxDescriptor {
public:
CSSSyntaxDescriptor(String syntax);
explicit CSSSyntaxDescriptor(const String& syntax);

const CSSValue* Parse(CSSParserTokenRange,
const CSSParserContext*,
Expand Down

0 comments on commit 58ee710

Please sign in to comment.