<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On 25 October 2013 04:04, Dimitar Zhekov <span dir="ltr"><<a href="mailto:dimitar.zhekov@gmail.com" target="_blank">dimitar.zhekov@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thu, 24 Oct 2013 19:22:34 +1100<br>
Lex Trotman <<a href="mailto:elextr@gmail.com">elextr@gmail.com</a>> wrote:<br>
<br>
> Unfortunately there is an accessor document_index() in the plugin interface<br>
> that uses the index into the array.<br>
><br>
> Switching to a list means that there needs to be a change everywhere in<br>
> Geany and the plugins that the array index is used instead of a pointer.  I<br>
> don't see anywhere where the index is used inside Geany but I may have<br>
> missed somewhere.  I don't know how often its used by plugins.  But again<br>
> its use could be deprecated and a temporary map (eg g_tree) from an int to<br>
> the pointer could be used until plugins are modified.<br>
<br>
</div>From what I see, document_index() is used in the plugins:<br>
<br>
- inside foreach_document(i), which makes zero sense<br>
- in a similar loop in codenav, where the number of documents is<br>
  copied in a local variable, without an obvious reason, and there<br>
  is no is_valid check<br>
- in geanypy, to implement a Python document_index() function.<br></blockquote><div><br></div><div>Thanks.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
That being said, just how is a list better than a GPtrArray?<br></blockquote><div><br></div><div>True, its the fact that the index is held constant because it might be stored and re-used that stops the array from being shrunk.  Getting rid of the use of indexes is the necessary pre-condition for shrinking the array, or using a list or whatever.</div>
<div><br></div><div>Cheers</div><div>Lex</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
--<br>
E-gards: Jimmy<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Devel mailing list<br>
<a href="mailto:Devel@lists.geany.org">Devel@lists.geany.org</a><br>
<a href="https://lists.geany.org/cgi-bin/mailman/listinfo/devel" target="_blank">https://lists.geany.org/cgi-bin/mailman/listinfo/devel</a><br>
</div></div></blockquote></div><br></div></div>