From a41ae7d69c1f51880a5f41ee6e351fa8e0f83d73 Mon Sep 17 00:00:00 2001 From: Florian Kothmeier Date: Sun, 10 Sep 2023 00:22:53 +0200 Subject: Use pass by reference in ZIPPacker & ZIPReader signatures --- modules/zip/zip_packer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/zip/zip_packer.cpp') diff --git a/modules/zip/zip_packer.cpp b/modules/zip/zip_packer.cpp index c8b4fb4e77..5f623476fc 100644 --- a/modules/zip/zip_packer.cpp +++ b/modules/zip/zip_packer.cpp @@ -33,7 +33,7 @@ #include "core/io/zip_io.h" #include "core/os/os.h" -Error ZIPPacker::open(String p_path, ZipAppend p_append) { +Error ZIPPacker::open(const String &p_path, ZipAppend p_append) { if (fa.is_valid()) { close(); } @@ -55,7 +55,7 @@ Error ZIPPacker::close() { return err; } -Error ZIPPacker::start_file(String p_path) { +Error ZIPPacker::start_file(const String &p_path) { ERR_FAIL_COND_V_MSG(fa.is_null(), FAILED, "ZIPPacker must be opened before use."); zip_fileinfo zipfi; @@ -76,7 +76,7 @@ Error ZIPPacker::start_file(String p_path) { return err == ZIP_OK ? OK : FAILED; } -Error ZIPPacker::write_file(Vector p_data) { +Error ZIPPacker::write_file(const Vector &p_data) { ERR_FAIL_COND_V_MSG(fa.is_null(), FAILED, "ZIPPacker must be opened before use."); return zipWriteInFileInZip(zf, p_data.ptr(), p_data.size()) == ZIP_OK ? OK : FAILED; -- cgit v1.2.3