Simplify ClassLinker::LoadClass
Starting out by removing the ClassLinker::LoadClass to not take a
DexFile. Then started pulling threads so that ClassLinker::LoadClass
could take a StringPiece instead of const char*. Finally went through
and removed all uses of StringPiece::data() to make sure things are
clean.
Change-Id: I47cfa0e8e0e35a31e0ebbd0f7d6a105be83ebe88
diff --git a/src/stringpiece.cc b/src/stringpiece.cc
index 4b1ef7b..9927309 100644
--- a/src/stringpiece.cc
+++ b/src/stringpiece.cc
@@ -34,7 +34,7 @@
return ret;
}
-int StringPiece::find(const StringPiece& s, size_type pos) const {
+StringPiece::size_type StringPiece::find(const StringPiece& s, size_type pos) const {
if (length_ < 0 || pos > static_cast<size_type>(length_))
return npos;
@@ -53,7 +53,7 @@
return r;
}
-int StringPiece::find(char c, size_type pos) const {
+StringPiece::size_type StringPiece::find(char c, size_type pos) const {
if (length_ <= 0 || pos >= static_cast<size_type>(length_)) {
return npos;
}
@@ -61,7 +61,7 @@
return result != ptr_ + length_ ? result - ptr_ : npos;
}
-int StringPiece::rfind(const StringPiece& s, size_type pos) const {
+StringPiece::size_type StringPiece::rfind(const StringPiece& s, size_type pos) const {
if (length_ < s.length_) return npos;
const size_t ulen = length_;
if (s.length_ == 0) return std::min(ulen, pos);
@@ -71,7 +71,7 @@
return result != last ? result - ptr_ : npos;
}
-int StringPiece::rfind(char c, size_type pos) const {
+StringPiece::size_type StringPiece::rfind(char c, size_type pos) const {
if (length_ <= 0) return npos;
for (int i = std::min(pos, static_cast<size_type>(length_ - 1));
i >= 0; --i) {