ggml: added/removed const references for simple types and structures less 16 bytes

Reference: https://stackoverflow.com/a/3314034
This commit is contained in:
Herman Semenov 2025-01-21 18:58:31 +03:00
parent a1649cc13f
commit 44ec40a43a
2 changed files with 4 additions and 4 deletions

View File

@ -376,7 +376,7 @@ static std::vector<ggml_backend_dev_t> 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<std::string>(servers, ',');
if (rpc_servers.empty()) {
throw std::invalid_argument("no RPC servers specified");

View File

@ -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));
}