Skip to content

Feature/map list optimizations - #844

Merged
GoogleFrog merged 6 commits into
ZeroK-RTS:masterfrom
moreginger:feature/map-list-optimizations
Apr 11, 2023
Merged

Feature/map list optimizations#844
GoogleFrog merged 6 commits into
ZeroK-RTS:masterfrom
moreginger:feature/map-list-optimizations

Conversation

@moreginger

@moreginger moreginger commented Mar 11, 2023

Copy link
Copy Markdown

The return of #798

I think wrapping text is OK?

Timed AddTheNextBatchOfMaps before: 0.29s after 0.25s

image

mapItem.TerrainType = ToTerrainType(mapItem)
mapItems[#mapItems+1] = mapItem
end
table.sort(mapItems, function(l, r) return l.Name:upper() < r.Name:upper() end)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bonus feature, make the paged loading of map items not populate the table in a funny order.

end

table.merge(obj[i], v)
if (t == "metatable") then

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't seem likely this branch does anything. How would type(v) be "metatable"?

return newTable
end

function table:arrayshallowcopy()

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this function as it is unused and broken.

end
end

function table:arraymap(fun)

@moreginger moreginger Mar 11, 2023

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this function as it is unused and broken.

elseif sv then
table.merge(sv, v)
else
self[i] = table.deepcopy(v)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deepcopy is faster than recursive merge if we know we are copying

@moreginger
moreginger marked this pull request as ready for review March 11, 2023 15:45
@GoogleFrog
GoogleFrog merged commit ca797ed into ZeroK-RTS:master Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants