Skip to content

Commit

Permalink
s/isEmpty/empty/g
Browse files Browse the repository at this point in the history
  • Loading branch information
Andersbakken committed Nov 1, 2021
1 parent 675d645 commit 1e1ee4b
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 59 deletions.
2 changes: 1 addition & 1 deletion src/ClangIndexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ bool ClangIndexer::exec(const String &data)

if (ClangIndexer::state() == Stopped)
return true;
if (!mTrailer.isEmpty()) {
if (!mTrailer.empty()) {
message += " (" + mTrailer + ')';
}
message += String::format<16>(" in %lldms. ", mTimer.elapsed());
Expand Down
2 changes: 1 addition & 1 deletion src/DependenciesJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ int DependenciesJob::execute()
{
for (const auto &proj : projects()) {
String ret = proj->dumpDependencies(mFileId, mArgs, queryFlags());
if (!ret.isEmpty()) {
if (!ret.empty()) {
write(ret);
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/IndexParseData.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class IndexParseData
Sources sources;
List<String> environment;

bool empty() const { return environment.isEmpty() && sources.isEmpty(); }
bool empty() const { return environment.empty() && sources.empty(); }
bool write(const std::function<bool(const String &)> &write, const Match &match = Match()) const;
};

Expand Down
12 changes: 6 additions & 6 deletions src/Project.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ bool Project::init(const Path &srcPath, uint32_t compileCommandsFileId)
return Path::Continue;
});
auto parseData = std::move(mIndexParseData);
processParseData(std::move(parseData), ProcessParseData::Init);
processParseData(std::move(parseData));
};

DataFile file(mProjectFilePath, RTags::DatabaseVersion);
Expand Down Expand Up @@ -447,7 +447,7 @@ void Project::check(CheckMode checkMode)
bool outputDirty = false;
if (checkMode == Check_Init && mDependencies.size() >= 100) {
String name = mPath;
if (!mTrailer.isEmpty())
if (!mTrailer.empty())
name += " (" + mTrailer + ')';
logDirect(LogLevel::Error, String::format<128>("Restoring %s ", name.constData()), LogOutput::StdOut);
outputDirty = true;
Expand Down Expand Up @@ -1382,11 +1382,11 @@ Set<FixIt> Project::fixIts(uint32_t fileId) const
String Project::fixItsToString(const Set<FixIt> &fixIts)
{
String out;
if (!fixIts.isEmpty()) {
if (!fixIts.empty()) {
auto f = fixIts.end();
do {
--f;
if (!out.isEmpty())
if (!out.empty())
out.append('\n');
out.append(String::format<32>("%d:%d %d %s", f->line, f->column, f->length, f->text.constData()));
} while (f != fixIts.begin());
Expand Down Expand Up @@ -2526,7 +2526,7 @@ void Project::reloadCompileCommands()
}
// removeSources(removed);
if (found)
processParseData(std::move(data), ProcessParseData::ReloadCompileCommands);
processParseData(std::move(data));
}
}

Expand Down Expand Up @@ -2613,7 +2613,7 @@ void Project::reindex(uint32_t fileId, Flags<IndexerJob::Flag> flags)
index(std::make_shared<IndexerJob>(sources(fileId), flags, shared_from_this()));
}

void Project::processParseData(IndexParseData &&data, ProcessParseData type)
void Project::processParseData(IndexParseData &&data)
{
Set<uint32_t> index;
Hash<uint32_t, uint32_t> removed;
Expand Down
7 changes: 1 addition & 6 deletions src/Project.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,7 @@ class Project : public std::enable_shared_from_this<Project>

bool isIndexed(uint32_t fileId) const;

enum class ProcessParseData {
Init,
ReloadCompileCommands,
IndexMessage
};
void processParseData(IndexParseData &&data, ProcessParseData type);
void processParseData(IndexParseData &&data);
const IndexParseData &indexParseData() const { return mIndexParseData; }
void index(const std::shared_ptr<IndexerJob> &job);
void reindex(uint32_t fileId, Flags<IndexerJob::Flag> flags);
Expand Down
8 changes: 4 additions & 4 deletions src/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ static size_t sharedRoot(const Path &a, const Path &b)

void Server::updateTrailers(const List<std::shared_ptr<Project>> &projects)
{
assert(!projects.isEmpty());
assert(!projects.empty());
if (projects.size() == 1) {
projects.front()->setTrailer(String());
} else {
Expand All @@ -381,7 +381,7 @@ void Server::updateTrailers(const List<std::shared_ptr<Project>> &projects)
names.append(Location::path(projects[0]->compileCommandsFileId()).parentDir());
size_t sharedRootLength = std::numeric_limits<size_t>::max();
size_t startIndex = 0;
if (names[0].isEmpty()) {
if (names[0].empty()) {
names[0] = "none";
++startIndex;
names.append(Location::path(projects[1]->compileCommandsFileId()).parentDir());
Expand Down Expand Up @@ -1004,7 +1004,7 @@ bool Server::load()
for (auto &pp : s.second) {
auto p = addProject(s.first, pp.compileCommandsFileId);
if (p) {
p->processParseData(std::move(pp), Project::ProcessParseData::Init);
p->processParseData(std::move(pp));
p->save();
}
}
Expand Down Expand Up @@ -1303,7 +1303,7 @@ void Server::prepareCompletion(const std::shared_ptr<QueryMessage> &query, uint3
mCompletionThread->start();
}

if (mCompletionThread && fileId && !projects.isEmpty()) {
if (mCompletionThread && fileId && !projects.empty()) {
for (const auto &project : projects) {
if (mCompletionThread->isCached(project, fileId)) {
return;
Expand Down
Loading

0 comments on commit 1e1ee4b

Please sign in to comment.