remove at(index) reference function

remove chrUpr and chrLwr from PIString
This commit is contained in:
2020-09-10 12:37:33 +03:00
parent b11ebc8100
commit 05b48af153
6 changed files with 4 additions and 28 deletions

View File

@@ -613,7 +613,7 @@ PIString PIString::trimmed() const {
PIString & PIString::replace(int from, int count, const PIString & with) {
count = piMini(count, length() - from);
if (count == with.size_s())
memcpy(&(at(from)), &(with.at(0)), count * sizeof(PIChar));
memcpy(PIDeque<PIChar>::data(from), static_cast<PIDeque<PIChar>>(with).data(), count * sizeof(PIChar));
else {
remove(from, count);
PIDeque<PIChar>::insert(from, with);
@@ -671,7 +671,7 @@ PIString & PIString::replaceAll(const PIString & what, const char with) {
}
if (!match) continue;
if (dl > 0) PIDeque<PIChar>::remove(i, dl);
at(i) = PIChar(with);
(*this)[i] = PIChar(with);
//i -= l;
}
return *this;
@@ -682,7 +682,7 @@ PIString & PIString::replaceAll(const char what, const char with) {
int l = length();
for (int i = 0; i < l; ++i) {
if (at(i) == what)
at(i) = with;
(*this)[i] = with;
}
return *this;
}
@@ -1166,18 +1166,6 @@ PIString & PIString::setReadableSize(llong bytes) {
}
inline char chrUpr(char c) {
if (c >= 'a' && c <= 'z') return c + 'A' - 'a';
return c;
}
inline char chrLwr(char c) {
if (c >= 'A' && c <= 'Z') return c + 'a' - 'A';
return c;
}
const static PIString _versionDelims_ = PIStringAscii("._-+");