Removing unneeded eachAs() operators
authorTom Jackson <tjackson@fb.com>
Wed, 14 Nov 2012 03:20:58 +0000 (19:20 -0800)
committerJordan DeLong <jdelong@fb.com>
Sun, 16 Dec 2012 22:45:20 +0000 (14:45 -0800)
Summary: ##byLine## already yields StringPieces, no neat to ##eachAs()## then.

Test Plan:
fbconfig folly/experimental/symbolizer folly/test folly/experimental/io folly/experimental/io/test tupperware/agent
fbmake opt

Reviewed By: tudorb@fb.com

FB internal diff: D630422

folly/experimental/io/HugePages.cpp
folly/experimental/symbolizer/Symbolizer.cpp
folly/test/SubprocessTest.cpp

index e0e33bcc5821615d2f40bd5bc4f47d85c298751f..cf93ce0bc0046a977e8cd13bff2e930956609840 100644 (file)
@@ -54,7 +54,7 @@ size_t getDefaultHugePageSize() {
   size_t pageSize = 0;
   boost::cmatch match;
 
-  bool error = gen::byLine("/proc/meminfo") | gen::eachAs<StringPiece>() |
+  bool error = gen::byLine("/proc/meminfo") |
     [&] (StringPiece line) -> bool {
       if (boost::regex_match(line.begin(), line.end(), match, regex)) {
         StringPiece numStr(line.begin() + match.position(1), match.length(1));
index 714cac7604931b0c62cffba06c449266f9f5e44d..aa5280cda7cd28827461eef380bfed262f4e92a1 100644 (file)
@@ -77,7 +77,7 @@ bool Symbolizer::symbolize(uintptr_t address, StringPiece& symbolName,
   boost::cmatch match;
 
   MappedFile foundFile;
-  bool error = gen::byLine("/proc/self/maps") | gen::eachAs<StringPiece>() |
+  bool error = gen::byLine("/proc/self/maps") |
     [&] (StringPiece line) -> bool {
       CHECK(boost::regex_match(line.begin(), line.end(), match, mapLineRegex));
       uint64_t begin = fromHex(sp(match[1]));
index bf8e07680286a8d9e9c27fb07e89b362f1bca8ca..1b7c0079dab7180671cc435314e68e9662f099fe 100644 (file)
@@ -59,7 +59,7 @@ TEST(SimpleSubprocessTest, ShellExitsWithError) {
 TEST(PopenSubprocessTest, PopenRead) {
   Subprocess proc("ls /", Subprocess::pipeStdout());
   int found = 0;
-  gen::byLine(proc.stdout()) | gen::eachAs<StringPiece>() |
+  gen::byLine(proc.stdout()) |
     [&] (StringPiece line) {
       if (line == "etc" || line == "bin" || line == "usr") {
         ++found;