From 44ec40a43a3b6302a50aa934d8148cb8f5c11b71 Mon Sep 17 00:00:00 2001 From: Herman Semenov Date: Tue, 21 Jan 2025 18:58:31 +0300 Subject: [PATCH] ggml: added/removed const references for simple types and structures less 16 bytes Reference: https://stackoverflow.com/a/3314034 --- common/arg.cpp | 2 +- ggml/src/gguf.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/arg.cpp b/common/arg.cpp index dede335fb..d163c46e6 100644 --- a/common/arg.cpp +++ b/common/arg.cpp @@ -376,7 +376,7 @@ static std::vector parse_device_list(const std::string & val return devices; } -static void add_rpc_devices(std::string servers) { +static void add_rpc_devices(const std::string & servers) { auto rpc_servers = string_split(servers, ','); if (rpc_servers.empty()) { throw std::invalid_argument("no RPC servers specified"); diff --git a/ggml/src/gguf.cpp b/ggml/src/gguf.cpp index ab13669c5..8fc446308 100644 --- a/ggml/src/gguf.cpp +++ b/ggml/src/gguf.cpp @@ -1153,7 +1153,7 @@ struct gguf_writer { buf.insert(buf.end(), val.begin(), val.end()); } - void write(const bool & val) const { + void write(const bool val) const { const int8_t val8 = val ? 1 : 0; write(val8); } @@ -1172,11 +1172,11 @@ struct gguf_writer { write(std::string(val)); } - void write(const enum ggml_type & val) const { + void write(const enum ggml_type val) const { write(int32_t(val)); } - void write(const enum gguf_type & val) const { + void write(const enum gguf_type val) const { write(int32_t(val)); }