summaryrefslogtreecommitdiff
path: root/runtime/art_method.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/art_method.cc')
-rw-r--r--runtime/art_method.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/art_method.cc b/runtime/art_method.cc
index c7be2dc0ca..973dabe4f0 100644
--- a/runtime/art_method.cc
+++ b/runtime/art_method.cc
@@ -226,11 +226,11 @@ InvokeType ArtMethod::GetInvokeType() {
}
}
-size_t ArtMethod::NumArgRegisters(const char* shorty) {
- CHECK_NE(shorty[0], '\0');
+size_t ArtMethod::NumArgRegisters(std::string_view shorty) {
+ CHECK(!shorty.empty());
uint32_t num_registers = 0;
- for (const char* s = shorty + 1; *s != '\0'; ++s) {
- if (*s == 'D' || *s == 'J') {
+ for (char c : shorty.substr(1u)) {
+ if (c == 'D' || c == 'J') {
num_registers += 2;
} else {
num_registers += 1;