El dilluns, 12 de gener del 2026, a les 15:19:43 (Hora està ndard d’Europa central), Adam Sampson va escriure: > Albert Astals Cid <[email protected]> writes: > > And it's not like they are saving us much typing > > > > arrayGetLength() > > > > turns into > > > > getArray()->getLength() > > This sounds reasonable to me. The most common use in the Poppler code is > iterating through the items in an array, in which case turning the loop > into something like: > > auto array = whateverObj.getArray(); > for (int i = 0; i < array->getLength(); ++i) { > ... array->get(i) ... > } > > also potentially saves doing the OBJECT_TYPE check twice for each > iteration of the loop, and would make it easier to convert to range-for > loop form in the future. > > There are also 70-odd tests like: > > if (obj1.isArray() && obj1.arrayGetLength() == 2) > > How about adding Object::isArrayWithLength(int n) for these?
Please send a MR for it :) Cheers, Albert > > (xpopple had one use of arrayGet/arrayGetLength, which I've just > removed.) > > Thanks,
