SlickGrid icon indicating copy to clipboard operation
SlickGrid copied to clipboard

Unnecessary call to ensureIdUniqueness in slick.dataview.js:setItems

Open turchanov opened this issue 6 years ago • 0 comments

Hi!

It really seems that a call to ensureIdUniqueness right after updateIdxById() is superfluous in function setItems https://github.com/6pac/SlickGrid/blob/427e2bf9588f6b70b21845a3b46c720b4672b617/slick.dataview.js#L130-L139 because when the function updateIdxById traverses items, it checks that every data item has id property defined and builds idxById array https://github.com/6pac/SlickGrid/blob/427e2bf9588f6b70b21845a3b46c720b4672b617/slick.dataview.js#L104-L114 and the function ensureIdUniqueness yet again checks checks that every data item has id property defined and verifies that idxById references that item (which is true by construction in updateIdxById) https://github.com/6pac/SlickGrid/blob/427e2bf9588f6b70b21845a3b46c720b4672b617/slick.dataview.js#L116-L124 I would rather remove that unnecessary call to ensureIdUniqueness and the definition of that function since it is not used anywere else. I can push a pull request if you OK that change.

turchanov avatar May 02 '18 11:05 turchanov