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 e0e33bc..cf93ce0 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 714cac7..aa5280c 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 bf8e076..1b7c007 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;