From f56805ddde51ffcfdd6123300b6c049764a86980 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Wed, 2 Oct 2024 12:27:42 +0200 Subject: Replace manual new allocations for git_strarray with std::vectors ...and remove unused code from git_utils --- src/buildtool/file_system/git_utils.cpp | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'src/buildtool/file_system/git_utils.cpp') diff --git a/src/buildtool/file_system/git_utils.cpp b/src/buildtool/file_system/git_utils.cpp index d9833521..8612d039 100644 --- a/src/buildtool/file_system/git_utils.cpp +++ b/src/buildtool/file_system/git_utils.cpp @@ -82,38 +82,6 @@ void tree_closer(gsl::owner tree) { #endif } -void treebuilder_closer(gsl::owner builder) { -#ifndef BOOTSTRAP_BUILD_TOOL - git_treebuilder_free(builder); -#endif -} - -void index_closer(gsl::owner index) { -#ifndef BOOTSTRAP_BUILD_TOOL - git_index_free(index); -#endif -} - -void strarray_closer(gsl::owner strarray) { -#ifndef BOOTSTRAP_BUILD_TOOL - git_strarray_dispose(strarray); -#endif -} - -void strarray_deleter(gsl::owner strarray) { -#ifndef BOOTSTRAP_BUILD_TOOL - if (strarray->strings != nullptr) { - for (std::size_t i = 0; i < strarray->count; ++i) { - // NOLINTNEXTLINE(cppcoreguidelines-owning-memory,cppcoreguidelines-pro-bounds-pointer-arithmetic) - delete[] strarray->strings[i]; - } - delete[] strarray->strings; - strarray->strings = nullptr; - strarray->count = 0; - } -#endif -} - void signature_closer(gsl::owner signature) { #ifndef BOOTSTRAP_BUILD_TOOL git_signature_free(signature); -- cgit v1.2.3