Skip to content

Commit 77db2d8

Browse files
committed
FFstrbuf: remove ffStrbufCompAlphabetically
1 parent 15bb5bf commit 77db2d8

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/detection/disk/disk.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
const char* ffDetectDisksImpl(FFlist* disks);
44

5-
static int compareDisks(const void* disk1, const void* disk2)
5+
static int compareDisks(const FFDisk* disk1, const FFDisk* disk2)
66
{
7-
return ffStrbufCompAlphabetically(&((const FFDisk*) disk1)->mountpoint, &((const FFDisk*) disk2)->mountpoint);
7+
return ffStrbufComp(&disk1->mountpoint, &disk2->mountpoint);
88
}
99

1010
const char* ffDetectDisks(FFDiskOptions* options, FFlist* disks)
@@ -18,7 +18,7 @@ const char* ffDetectDisks(FFDiskOptions* options, FFlist* disks)
1818
// For example for /boot/efi/bootmgr we need to check /boot/efi before /boot
1919
//Note that we sort alphabetically here for a better ordering when printing the list,
2020
// so the check must be done in reverse order
21-
ffListSort(disks, compareDisks);
21+
ffListSort(disks, (void*) compareDisks);
2222
FF_LIST_FOR_EACH(FFDisk, disk, *disks)
2323
{
2424
if(disk->bytesTotal == 0)

src/util/FFstrbuf.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,6 @@ static inline int ffStrbufComp(const FFstrbuf* strbuf, const FFstrbuf* comp)
300300
return memcmp(strbuf->chars, comp->chars, length + 1);
301301
}
302302

303-
static inline int ffStrbufCompAlphabetically(const FFstrbuf* strbuf, const FFstrbuf* comp)
304-
{
305-
return strcmp(strbuf->chars, comp->chars);
306-
}
307-
308303
static inline FF_C_NODISCARD bool ffStrbufEqual(const FFstrbuf* strbuf, const FFstrbuf* comp)
309304
{
310305
return ffStrbufComp(strbuf, comp) == 0;

0 commit comments

Comments
 (0)