Now that I think about it some more, I am inclined to leave both functions alone, and just add some comments to the source about their equivalency<br><br>On Friday, May 6, 2016, Ralph Versteegen <<a href="mailto:teeemcee@gmail.com">teeemcee@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 6 May 2016 at 22:40, Ralph Versteegen <<a href="javascript:;" onclick="_e(event, 'cvml', 'teeemcee@gmail.com')">teeemcee@gmail.com</a>> wrote:<br>
> On 6 May 2016 at 10:01, James Paige <<a href="javascript:;" onclick="_e(event, 'cvml', 'Bob@hamsterrepublic.com')">Bob@hamsterrepublic.com</a>> wrote:<br>
>> I just noticed that the reload functions FirstChild and GetChildByName seem<br>
>> to be almost exactly the same.<br>
>><br>
>> GetChildByName's name argument is not optional, and it has something that<br>
>> appears to be a speed optimization<br>
>><br>
>> Is there any reason not to combine them? (probably by removing<br>
>> GetChildByName, and maybe adding its optimization to FirstChild?)<br>
>><br>
>> ---<br>
>> James<br>
><br>
> Yes, they could be combined, if "GetChildByName" in reloadbasic.py is<br>
> also replaced. The only possible reason not to is that it's not<br>
> obvious that the two functions are equivalent, so you won't know to<br>
> look for one when you want the other. I guess FirstChild may be the<br>
> better name because it's short :) and because it draws attention to<br>
> the fact that you get the other children with that name with<br>
> NextSibling. Alternatively we could removing the name argument to<br>
> FirstChild so there's no overlap.<br>
Hmm, but that wouldn't make much sense unless we also split<br>
Next/PreviousSibling into two functions each.<br>
We've also got a lot of functions related to GetChildByName, like<br>
GetChildNodeInt, etc, FindChildByName, GetOrCreateChild. I wish I knew<br>
how to make it more intuitive.<br>
<br>
> I hardly remember adding that optimisation to GetChildByName, but<br>
> would like to keep it.<br>
_______________________________________________<br>
Ohrrpgce mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', 'ohrrpgce@lists.motherhamster.org')">ohrrpgce@lists.motherhamster.org</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" target="_blank">http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org</a><br>
</blockquote>