From a90e064262f7f15c2083e758caf4153f94f2874a Mon Sep 17 00:00:00 2001 From: Xuan Son Nguyen Date: Thu, 2 Jan 2025 13:50:49 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Georgi Gerganov --- examples/server/server.cpp | 2 +- examples/server/utils.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/server/server.cpp b/examples/server/server.cpp index 8b02c1195..6d0812a92 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -2681,7 +2681,7 @@ struct server_context { // check if we can batch this slot with the previous one if (!slot_batched) { slot_batched = &slot; - } else if (slot_batched && !slot_batched->can_batch_with(slot)) { + } else if (!slot_batched->can_batch_with(slot)) { continue; } diff --git a/examples/server/utils.hpp b/examples/server/utils.hpp index 9658a0c8a..1cf08bb0a 100644 --- a/examples/server/utils.hpp +++ b/examples/server/utils.hpp @@ -826,7 +826,7 @@ static std::vector parse_lora_request( } // set value - for (auto entry : data) { + for (const auto & entry : data) { int id = json_value(entry, "id", -1); float scale = json_value(entry, "scale", 0.0f); if (0 <= id && id < max_idx) {