After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 757363 - Don't use g_list_length unless we really need to
Don't use g_list_length unless we really need to
Status: RESOLVED FIXED
Product: gnome-photos
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME photos maintainer(s)
GNOME photos maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-10-30 13:35 UTC by Debarshi Ray
Modified: 2015-12-08 08:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
base-item: Avoid O(n) logic (862 bytes, patch)
2015-10-30 13:36 UTC, Debarshi Ray
committed Details | Review
selection-toolbar: Avoid O(n) logic (2.56 KB, patch)
2015-10-30 13:37 UTC, Debarshi Ray
committed Details | Review
fetch-collection-state-job: Avoid O(n) logic (2.14 KB, patch)
2015-10-30 13:37 UTC, Debarshi Ray
committed Details | Review
selection-toolbar: Unbreak printing (995 bytes, patch)
2015-11-30 16:02 UTC, Debarshi Ray
committed Details | Review

Description Debarshi Ray 2015-10-30 13:35:02 UTC
g_list_length is O(n) because it iterates over the GList to find its length. There are often better alternatives which we can use.
Comment 1 Debarshi Ray 2015-10-30 13:36:52 UTC
Created attachment 314481 [details] [review]
base-item: Avoid O(n) logic
Comment 2 Debarshi Ray 2015-10-30 13:37:23 UTC
Created attachment 314482 [details] [review]
selection-toolbar: Avoid O(n) logic
Comment 3 Debarshi Ray 2015-10-30 13:37:54 UTC
Created attachment 314483 [details] [review]
fetch-collection-state-job: Avoid O(n) logic
Comment 4 Debarshi Ray 2015-11-10 11:26:00 UTC
Pushed to master.
Comment 5 Debarshi Ray 2015-11-30 16:02:34 UTC
Created attachment 316536 [details] [review]
selection-toolbar: Unbreak printing
Comment 6 Debarshi Ray 2015-11-30 16:12:09 UTC
From #documents on GIMPNet:

16:02 <rishi> abono_: Fixed printing:                                           
      https://bugzilla.gnome.org/show_bug.cgi?id=757363
16:02 <rishi> Does it look OK?
16:05 <abono_> yes it looks ok.