瀏覽代碼

Rename StringPieceTrimWhitespace() for rewriting purposes.

Josh Haberman 6 年之前
父節點
當前提交
9851c703ae

+ 3 - 3
src/google/protobuf/compiler/objectivec/objectivec_helpers.cc

@@ -364,7 +364,7 @@ string StripProto(const string& filename) {
   }
 }
 
-void StringPieceTrimWhitespace(StringPiece* input) {
+void TrimWhitespace(StringPiece* input) {
   while (!input->empty() && ascii_isspace(*input->data())) {
     input->remove_prefix(1);
   }
@@ -1054,8 +1054,8 @@ bool ExpectedPrefixesCollector::ConsumeLine(
   }
   StringPiece package(line, 0, offset);
   StringPiece prefix(line, offset + 1, line.length() - offset - 1);
-  StringPieceTrimWhitespace(&package);
-  StringPieceTrimWhitespace(&prefix);
+  TrimWhitespace(&package);
+  TrimWhitespace(&prefix);
   // Don't really worry about error checking the package/prefix for
   // being valid.  Assume the file is validated when it is created/edited.
   (*prefix_map_)[package.ToString()] = prefix.ToString();

+ 1 - 1
src/google/protobuf/compiler/objectivec/objectivec_helpers.h

@@ -62,7 +62,7 @@ string PROTOC_EXPORT EscapeTrigraphs(const string& to_escape);
 string PROTOC_EXPORT StripProto(const string& filename);
 
 // Remove white space from either end of a StringPiece.
-void PROTOC_EXPORT StringPieceTrimWhitespace(StringPiece* input);
+void PROTOC_EXPORT TrimWhitespace(StringPiece* input);
 
 // Returns true if the name requires a ns_returns_not_retained attribute applied
 // to it.