summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2024-06-17 15:22:05 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2024-06-17 15:23:00 -0700
commitb4e4b6259ded2c394b8b6c601ab0668add4f234b (patch)
tree4b604941957c80d81876913f78a7fb80fb85a7f1
parent1315c900e1ddbb08a23e06eeb9a06450052ccb5e (diff)
LSC: Move expensive variables on their last use to avoid copies.
PiperOrigin-RevId: 644150551 Change-Id: I11f3f8463fcfdb8d0284b1ab320624bbce6d1e48
-rw-r--r--absl/time/format.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/absl/time/format.cc b/absl/time/format.cc
index 15a26b14..bd06f8fb 100644
--- a/absl/time/format.cc
+++ b/absl/time/format.cc
@@ -16,6 +16,7 @@
#include <cctype>
#include <cstdint>
+#include <utility>
#include "absl/strings/match.h"
#include "absl/strings/string_view.h"
@@ -136,7 +137,7 @@ bool ParseTime(absl::string_view format, absl::string_view input,
if (b) {
*time = Join(parts);
} else if (err != nullptr) {
- *err = error;
+ *err = std::move(error);
}
return b;
}