[glib] GSequence: document that _get_length() is not O(1)



commit 2bc32606c73ccb66f86444b60bf0eabc9c959fb3
Author: Xavier Claessens <xavier claessens collabora com>
Date:   Thu Oct 22 16:23:12 2015 -0400

    GSequence: document that _get_length() is not O(1)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756988

 glib/gsequence.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/glib/gsequence.c b/glib/gsequence.c
index 475990a..3ed1eb8 100644
--- a/glib/gsequence.c
+++ b/glib/gsequence.c
@@ -1231,7 +1231,9 @@ g_sequence_set (GSequenceIter *iter,
  * g_sequence_get_length:
  * @seq: a #GSequence
  *
- * Returns the length of @seq
+ * Returns the length of @seq. Note that this method is O(h) where `h' is the
+ * height of the tree. It is thus more efficient to use g_sequence_is_empty()
+ * when comparing the length to zero.
  *
  * Returns: the length of @seq
  *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]