summaryrefslogtreecommitdiff
path: root/adb/adb_utils.h
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2019-05-03 09:02:45 -0700
committerElliott Hughes <enh@google.com>2019-05-03 12:49:31 -0700
commitb4dc7be6c57a911c8f496af188a15efdeb8ec2bc (patch)
tree3e2ffd39f262073f43528c25845860dcb46b43d2 /adb/adb_utils.h
parent56311071fec472ab546a6722295e84e4b4920c85 (diff)
libbase: add ConsumePrefix/ConsumeSuffix.
adb was already using ConsumePrefix, and now we have another would-be user in cutils. (There appears to be one place in adb that should use ConsumeSuffix, so I'm assuming we'll want that sooner or later.) I've kept these inline because adb and google3's versions both were, and I'm easily led. Test: treehugger Change-Id: I29d99032f6f6ccbfaefece59725db8afb02a4c87
Diffstat (limited to 'adb/adb_utils.h')
-rw-r--r--adb/adb_utils.h8
1 files changed, 0 insertions, 8 deletions
diff --git a/adb/adb_utils.h b/adb/adb_utils.h
index 5800a62f7..8b0dcee83 100644
--- a/adb/adb_utils.h
+++ b/adb/adb_utils.h
@@ -141,11 +141,3 @@ inline bool ParseUint(T* result, std::string_view str, std::string_view* remaini
return true;
}
-
-inline bool ConsumePrefix(std::string_view* str, std::string_view prefix) {
- if (str->starts_with(prefix)) {
- str->remove_prefix(prefix.size());
- return true;
- }
- return false;
-}