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