From d8134df679fc1ab647857fe6846f25d60834151e Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" <277429+mackal@users.noreply.github.com> Date: Sat, 3 Sep 2022 17:36:45 -0400 Subject: [PATCH] Clang was complaining about these (#2421) Checking if first char is null should be faster than strlen --- zone/object.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zone/object.cpp b/zone/object.cpp index 6af66895f..189d44509 100644 --- a/zone/object.cpp +++ b/zone/object.cpp @@ -144,8 +144,8 @@ Object::Object(Client* client, const EQ::ItemInstance* inst) // Set object name if (inst) { const EQ::ItemData* item = inst->GetItem(); - if (item && item->IDFile) { - if (strlen(item->IDFile) == 0) { + if (item) { + if (item->IDFile[0] == '\0') { strcpy(m_data.object_name, DEFAULT_OBJECT_NAME); } else { @@ -200,8 +200,8 @@ Object::Object(const EQ::ItemInstance *inst, float x, float y, float z, float he // Set object name if (inst) { const EQ::ItemData* item = inst->GetItem(); - if (item && item->IDFile) { - if (strlen(item->IDFile) == 0) { + if (item) { + if (item->IDFile[0] == '\0') { strcpy(m_data.object_name, DEFAULT_OBJECT_NAME); } else {