Skip to content

Replace ke::Vector with std::vector.#1283

Merged
dvander merged 1 commit intomasterfrom
rm-v
May 31, 2020
Merged

Replace ke::Vector with std::vector.#1283
dvander merged 1 commit intomasterfrom
rm-v

Conversation

@dvander
Copy link
Member

@dvander dvander commented May 31, 2020

No description provided.

Copy link
Member

@Headline Headline left a comment

Choose a reason for hiding this comment

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

I didn’t ditto repeated changes

I’m cool with taking this as-is if we want to finalize it later, but we can clean up more

return false;

m_items.remove(position);
ke::RemoveAt(&m_items, position);
Copy link
Member

Choose a reason for hiding this comment

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

Any reason we’re not doing

m_items.erase(m_items.begin()+ position)

val.pData.vval = new uint8_t[size + sizeof(size)];
reinterpret_cast<size_t *>(val.pData.vval)[0] = size;
elements.insert(position, val);
ke::InsertAt(&elements, position, val);
Copy link
Member

Choose a reason for hiding this comment

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

std::vector::insert?

}
void ReleaseMembers() {
for (size_t i = 0; i < this->length(); i++) {
for (size_t i = 0; i < this->size(); i++) {
Copy link
Member

Choose a reason for hiding this comment

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

range based for

Copy link
Member Author

Choose a reason for hiding this comment

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

To minimize friction (and time spent writing these patches), I tried to make these changes as syntax-preserving as I could. Improvements like range-based for loops can be done as needed. The argument for RemoveAt/InsertAt is weaker though so I'll revert those.

@dvander dvander merged commit 5d94f0b into master May 31, 2020
@dvander dvander deleted the rm-v branch May 31, 2020 18:35
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