Skip to content

Commit

Permalink
s/last/back/g
Browse files Browse the repository at this point in the history
  • Loading branch information
Andersbakken committed Jun 24, 2021
1 parent fdf4bf5 commit 25cc1a8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
12 changes: 6 additions & 6 deletions src/ClangIndexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ bool ClangIndexer::superclassTemplateMemberFunctionUgleHack(const CXCursor &curs
// for details. I really should report this as a bug.
if (cursorPtr)
*cursorPtr = nullptr;
if (kind != CXCursor_MemberRefExpr && clang_getCursorKind(mParents.last()) != CXCursor_CallExpr)
if (kind != CXCursor_MemberRefExpr && clang_getCursorKind(mParents.back()) != CXCursor_CallExpr)
return false;

const CXCursor templateRef = RTags::findChild(cursor, CXCursor_TemplateRef);
Expand Down Expand Up @@ -980,7 +980,7 @@ bool ClangIndexer::superclassTemplateMemberFunctionUgleHack(const CXCursor &curs
if (!name.empty()) {
RTags::Filter out;
out.kinds.insert(CXCursor_MemberRefExpr);
const int argCount = RTags::children(mParents.last(), RTags::Filter(), out).size();
const int argCount = RTags::children(mParents.back(), RTags::Filter(), out).size();
RTags::Filter in(RTags::Filter::And);
in.names.insert(name);
in.argumentCount = argCount;
Expand Down Expand Up @@ -1232,9 +1232,9 @@ bool ClangIndexer::handleReference(const CXCursor &cursor, CXCursorKind kind, Lo
}

if (mInTemplateFunction && !mParents.empty()) {
if ((kind == CXCursor_DeclRefExpr && mParents.last() == CXCursor_MemberRefExpr)
|| (kind == CXCursor_TypeRef && mParents.last() == CXCursor_DeclRefExpr)) {
CXSourceRange parentRange = clang_getCursorExtent(mParents.last());
if ((kind == CXCursor_DeclRefExpr && mParents.back() == CXCursor_MemberRefExpr)
|| (kind == CXCursor_TypeRef && mParents.back() == CXCursor_DeclRefExpr)) {
CXSourceRange parentRange = clang_getCursorExtent(mParents.back());
CXToken *tokens = nullptr;
unsigned numTokens = 0;
auto tu = mTranslationUnits.at(mCurrentTranslationUnit)->unit;
Expand All @@ -1260,7 +1260,7 @@ bool ClangIndexer::handleReference(const CXCursor &cursor, CXCursorKind kind, Lo
sym.kind = CXCursor_DeclRefExpr; // yes this is weird
}
sym.flags = Symbol::TemplateReference;
setType(sym, clang_getCursorType(mParents.last()));
setType(sym, clang_getCursorType(mParents.back()));
setRange(sym, memberRange);
if (kind == CXCursor_DeclRefExpr) // there might be more than one level of ::
break;
Expand Down
2 changes: 1 addition & 1 deletion src/JobScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void JobScheduler::add(const std::shared_ptr<IndexerJob> &job)
if (mPendingJobs.empty() || job->priority() > mPendingJobs.front()->job->priority()) {
mPendingJobs.prepend(node);
} else {
std::shared_ptr<Node> after = mPendingJobs.last();
std::shared_ptr<Node> after = mPendingJobs.back();
while (job->priority() > after->job->priority()) {
after = after->prev;
assert(after);
Expand Down
2 changes: 1 addition & 1 deletion src/ListSymbolsJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ int ListSymbolsJob::execute()
for (const auto &filter : filters) {
if (filter.mode == QueryMessage::PathFilter::Self) {
paths.append(filter.pattern);
if (!paths.last().isFile()) {
if (!paths.back().isFile()) {
paths.clear();
break;
}
Expand Down
14 changes: 7 additions & 7 deletions src/Project.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2224,27 +2224,27 @@ static List<String> split(const String &value, size_t max)
size_t i = 0;
while (i < words.size()) {
const String &word = words.at(i);
if (ret.last().size() && ret.last().size() + word.size() > max) {
fixString(ret.last(), max);
if (ret.back().size() && ret.back().size() + word.size() > max) {
fixString(ret.back(), max);
ret.append(String());
continue;
}

if (word.size() > max) {
assert(ret.last().empty());
assert(ret.back().empty());
for (size_t j=0; j<word.size(); j += max) {
if (j)
ret.append(String());
ret.last() = word.mid(j, max);
fixString(ret.last(), max);
ret.back() = word.mid(j, max);
fixString(ret.back(), max);
}
} else {
ret.last().append(word);
ret.back().append(word);
}
++i;
}

fixString(ret.last(), max);
fixString(ret.back(), max);
return ret;
}

Expand Down

0 comments on commit 25cc1a8

Please sign in to comment.