Skip to content

Commit

Permalink
cosmetic
Browse files Browse the repository at this point in the history
  • Loading branch information
elfmz committed Sep 16, 2024
1 parent e8fc002 commit 7b5fb8e
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions far2l/src/hilight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1063,29 +1063,13 @@ void HighlightFiles::SaveHiData()

static bool operator==(const HighlightDataColor &hl1, const HighlightDataColor &hl2)
{
#if 0
return !memcmp(&hl1, &hl2, sizeof(HighlightDataColor));
#else
if (hl1.MarkLen != hl2.MarkLen)
if (hl1.Flags != hl2.Flags || hl1.MarkLen != hl2.MarkLen)
return false;
if (hl1.Flags != hl2.Flags)
return false;

if (hl1.MarkLen)
if (memcmp(&hl1.Mark[0], &hl2.Mark[0], sizeof(wchar_t) * hl1.MarkLen))
return false;

for (size_t i = 0; i < ARRAYSIZE(hl1.Color); ++i) {
for (size_t j = 0; j < ARRAYSIZE(hl1.Color[i]); ++j) {
if (hl1.Color[i][j] != hl2.Color[i][j])
return false;
if (hl1.Mask[i][j] != hl2.Mask[i][j])
return false;
}
}
if (hl1.MarkLen && wmemcmp(&hl1.Mark[0], &hl2.Mark[0], hl1.MarkLen) != 0)
return false;

return true;
#endif
return (hl1.Color == hl2.Color && hl1.Mask == hl2.Mask);
}


Expand Down

0 comments on commit 7b5fb8e

Please sign in to comment.