Improvement fbvector.computePushBackCapacity
[folly.git] / folly / Format.cpp
index 53a218622d812a7bb6fe63b2baf5e99d0e5b4682..feec8fb255c3f9b4c15807e22f43e9433aad56d8 100644 (file)
@@ -96,7 +96,15 @@ void FormatArg::initSlow() {
       while (p != end && *p >= '0' && *p <= '9') {
         ++p;
       }
-      precision = to<int>(StringPiece(b, p));
+      if (p != b) {
+        precision = to<int>(StringPiece(b, p));
+        if (p != end && *p == '.') {
+          trailingDot = true;
+          ++p;
+        }
+      } else {
+        trailingDot = true;
+      }
 
       if (p == end) return;
     }