[gnome-photos] base-item: Avoid O(n) logic
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] base-item: Avoid O(n) logic
- Date: Tue, 10 Nov 2015 11:25:06 +0000 (UTC)
commit cc4a60395b0e10114c142cd6d5071ba53f2278dc
Author: Debarshi Ray <debarshir gnome org>
Date: Fri Oct 30 14:05:29 2015 +0100
base-item: Avoid O(n) logic
To check whether a GList is non-empty, it is faster to check it against
NULL.
https://bugzilla.gnome.org/show_bug.cgi?id=757363
src/photos-base-item.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index 7c573a5..ae1ae1c 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -225,7 +225,7 @@ photos_base_item_check_effects_and_update_info (PhotosBaseItem *self)
emblem_icons = g_list_prepend (emblem_icons, pix);
}
- if (g_list_length (emblem_icons) > 0)
+ if (emblem_icons != NULL)
{
GIcon *emblemed_icon;
GList *l;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]