Skip to content

Remove: ExpandingArray type in favour of sets, maps and vectors#65

Open
LordAro wants to merge 1 commit intoOpenTTD:masterfrom
LordAro:la-rm-expando
Open

Remove: ExpandingArray type in favour of sets, maps and vectors#65
LordAro wants to merge 1 commit intoOpenTTD:masterfrom
LordAro:la-rm-expando

Conversation

@LordAro
Copy link
Member

@LordAro LordAro commented Mar 11, 2026

Built on top of #58, but probably doesn't have to be

Similarly untested beyond compilation

Copy link
Contributor

@rubidium42 rubidium42 left a comment

Choose a reason for hiding this comment

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

Some nitpicking things. Not really that serious. Though by me approving PR64 and it getting merged this has some merge conflicts.

FeatData():var80(VarData(1)){}
ExpandingArray<VarData>vars;
ExpandingArray<VarData>var80;
FeatData() = default;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is defining a constructor actually needed here?

for(uint i=0;i<(uint)m.size();i++)
ret=std::max<short>(ret,m[i].feature);
for (const auto &[_, inf] : defined2IDs._m) {
ret=std::max<short>(ret, inf.feature);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
ret=std::max<short>(ret, inf.feature);
ret = std::max<short>(ret, inf.feature);

Comment on lines +79 to +99
if(langs & 0x10) {
if(nameLocs.contains(4)) IssueMessage(WARNING2,DUPLICATE_LANG_NAME,offset,4,nameLocs[4]);
nameLocs[4] = offset;
}
if(langs&0x08) {
if(nameLocs.contains(3)) IssueMessage(WARNING2,DUPLICATE_LANG_NAME,offset,3,nameLocs[3]);
nameLocs[3] = offset;
}
if(langs&0x04) {
if(nameLocs.contains(2)) IssueMessage(WARNING2,DUPLICATE_LANG_NAME,offset,2,nameLocs[2]);
nameLocs[2] = offset;
}
if(langs&0x02) {
if(nameLocs.contains(1)) IssueMessage(WARNING2,DUPLICATE_LANG_NAME,offset,1,nameLocs[1]);
nameLocs[1] = offset;
}
if(langs&0x01) {
if(nameLocs.contains(0)) IssueMessage(WARNING2,DUPLICATE_LANG_NAME,offset,0,nameLocs[0]);
nameLocs[0] = offset;
}
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

Spaces were added around the first &, but not the others.

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