< prev index next >
src/hotspot/share/oops/symbol.cpp
Print this page
*** 77,87 ****
// Tests if the symbol starts with the specified prefix of the given
// length.
bool Symbol::starts_with(const char* prefix, int len) const {
if (len > utf8_length()) return false;
while (len-- > 0) {
! if (prefix[len] != (char) byte_at(len))
return false;
}
assert(len == -1, "we should be at the beginning");
return true;
}
--- 77,87 ----
// Tests if the symbol starts with the specified prefix of the given
// length.
bool Symbol::starts_with(const char* prefix, int len) const {
if (len > utf8_length()) return false;
while (len-- > 0) {
! if (prefix[len] != char_at(len))
return false;
}
assert(len == -1, "we should be at the beginning");
return true;
}
*** 115,125 ****
char* Symbol::as_C_string(char* buf, int size) const {
if (size > 0) {
int len = MIN2(size - 1, utf8_length());
for (int i = 0; i < len; i++) {
! buf[i] = byte_at(i);
}
buf[len] = '\0';
}
return buf;
}
--- 115,125 ----
char* Symbol::as_C_string(char* buf, int size) const {
if (size > 0) {
int len = MIN2(size - 1, utf8_length());
for (int i = 0; i < len; i++) {
! buf[i] = char_at(i);
}
buf[len] = '\0';
}
return buf;
}
< prev index next >