Format all C++ and Java code via clang-format

Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
Konstantin Pastbin
2025-08-17 14:32:37 +07:00
parent 9f0290c0ec
commit bfffa1fff4
2169 changed files with 56441 additions and 64188 deletions

View File

@@ -7,17 +7,16 @@
#include "base/assert.hpp"
#include "base/cancellable.hpp"
namespace storage
{
namespace diffs
{
void ApplyDiff(ApplyDiffParams && p, base::Cancellable const & cancellable,
OnDiffApplicationFinished const & task)
void ApplyDiff(ApplyDiffParams && p, base::Cancellable const & cancellable, OnDiffApplicationFinished const & task)
{
using namespace generator::mwm_diff;
GetPlatform().RunTask(Platform::Thread::File, [p = std::move(p), &cancellable, task] {
GetPlatform().RunTask(Platform::Thread::File, [p = std::move(p), &cancellable, task]
{
CHECK(p.m_diffFile, ());
CHECK(p.m_oldMwmFile, ());
@@ -41,13 +40,9 @@ void ApplyDiff(ApplyDiffParams && p, base::Cancellable const & cancellable,
std::string const newMwmPath = diffFile->GetPath(MapFileType::Map);
std::string const diffApplyingInProgressPath = newMwmPath + DIFF_APPLYING_FILE_EXTENSION;
result = generator::mwm_diff::ApplyDiff(oldMwmPath, diffApplyingInProgressPath, diffPath,
cancellable);
if (result == DiffApplicationResult::Ok &&
!base::RenameFileX(diffApplyingInProgressPath, newMwmPath))
{
result = generator::mwm_diff::ApplyDiff(oldMwmPath, diffApplyingInProgressPath, diffPath, cancellable);
if (result == DiffApplicationResult::Ok && !base::RenameFileX(diffApplyingInProgressPath, newMwmPath))
result = DiffApplicationResult::Failed;
}
Platform::RemoveFileIfExists(diffApplyingInProgressPath);
@@ -57,23 +52,16 @@ void ApplyDiff(ApplyDiffParams && p, base::Cancellable const & cancellable,
switch (result)
{
case DiffApplicationResult::Ok:
diffFile->DeleteFromDisk(MapFileType::Diff);
break;
case DiffApplicationResult::Cancelled:
// The diff file will be deleted by storage.
// Another way would be to leave it on disk but all consequences
// of interacting with storage are much harder to be taken into account that way.
break;
case DiffApplicationResult::Failed:
diffFile->DeleteFromDisk(MapFileType::Diff);
break;
case DiffApplicationResult::Ok: diffFile->DeleteFromDisk(MapFileType::Diff); break;
case DiffApplicationResult::Cancelled:
// The diff file will be deleted by storage.
// Another way would be to leave it on disk but all consequences
// of interacting with storage are much harder to be taken into account that way.
break;
case DiffApplicationResult::Failed: diffFile->DeleteFromDisk(MapFileType::Diff); break;
}
GetPlatform().RunTask(Platform::Thread::Gui, [task, result]()
{
task(result);
});
GetPlatform().RunTask(Platform::Thread::Gui, [task, result]() { task(result); });
});
}
} // namespace diffs