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 795156 - gstqueuearray: make find() return a 0-based index
gstqueuearray: make find() return a 0-based index
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other All
: Normal enhancement
: 1.15.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-04-11 13:39 UTC by Mathieu Duponchelle
Modified: 2018-04-13 22:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gstqueuearray: make find() return a 0-based index (2.11 KB, patch)
2018-04-11 13:39 UTC, Mathieu Duponchelle
none Details | Review
gstqueuearray: make find() return a 0-based index (2.25 KB, patch)
2018-04-12 14:19 UTC, Mathieu Duponchelle
committed Details | Review

Description Mathieu Duponchelle 2018-04-11 13:39:47 UTC
See commit message
Comment 1 Mathieu Duponchelle 2018-04-11 13:39:53 UTC
Created attachment 370791 [details] [review]
gstqueuearray: make find() return a 0-based index

And make the drop() functions expect a 0-based index too,
this addresses a longstanding FIXME.
Comment 2 Tim-Philipp Müller 2018-04-11 13:53:15 UTC
Comment on attachment 370791 [details] [review]
gstqueuearray: make find() return a 0-based index

I would like to see a small unit test addition for this as well please, since it's currently not tested.

The commit message should also mention why/that this change in interpretation of the index argument to _drop_*() is not a backwards-incompatible change (because it could only be used with return values from _find anyway).
Comment 3 Mathieu Duponchelle 2018-04-11 15:57:34 UTC
(In reply to Tim-Philipp Müller from comment #2)
> Comment on attachment 370791 [details] [review] [review]
> gstqueuearray: make find() return a 0-based index
> 
> I would like to see a small unit test addition for this as well please,
> since it's currently not tested.

There is a test that uses find() and drop_element(), test_array_drop2, I figured this was sufficient?

> 
> The commit message should also mention why/that this change in
> interpretation of the index argument to _drop_*() is not a
> backwards-incompatible change (because it could only be used with return
> values from _find anyway).

sure, I'll update that
Comment 4 Tim-Philipp Müller 2018-04-11 16:09:52 UTC
Ah ok, ignore me then. Must up my grepping-fu then.
Comment 5 Mathieu Duponchelle 2018-04-12 14:19:50 UTC
Created attachment 370860 [details] [review]
gstqueuearray: make find() return a 0-based index

And make the drop() functions expect a 0-based index too,
this addresses a longstanding FIXME. This will not break
backward incompatible change, because the drop() functions
were previously only meant to be used with the index
returned by find().
Comment 6 Mathieu Duponchelle 2018-04-13 22:02:11 UTC
Attachment 370860 [details] pushed as 68761ee - gstqueuearray: make find() return a 0-based index