mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-21 19:38:25 +00:00
Clang was complaining about these (#2421)
Checking if first char is null should be faster than strlen
This commit is contained in:
committed by
GitHub
parent
89382d5e4a
commit
d8134df679
+4
-4
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user