8000 fix: replace unsafe while(*it) loops by bobtista · Pull Request #574 · TheSuperHackers/GeneralsGameCode · GitHub
[go: up one dir, main page]

Skip to content

fix: replace unsafe while(*it) loops#574

Closed
bobtista wants to merge 1 commit intoTheSuperHackers:mainfrom
bobtista:bobtista/fix-unsafe-iterator-dereference
Closed

fix: replace unsafe while(*it) loops#574
bobtista wants to merge 1 commit intoTheSuperHackers:mainfrom
bobtista:bobtista/fix-unsafe-iterator-dereference

Conversation

@bobtista
Copy link
@bobtista bobtista commented Apr 2, 2025

Addresses #302
Minimal changes for simple diff, we could refactor later to use for loops like it's done in other places.

Copy link
@xezon xezon left a comment

Choose a reason for hiding this comment

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

Looks fine in principle.


while( *it )
ContainedItemsList::const_iterator end = items->end();
while( it != end )
Copy link

Choose a reason for hiding this comment

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

Put space between loop and variable like at the other places.

@@ -347,8 +347,8 @@ UpdateSleepTime MobNexusContain::update()
{
ContainedItemsList::const_iterator it;
it = items->begin();
Copy link

Choose a reason for hiding this comment

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

While at it, perhaps make the declaration and assignment a single line? Looks a bit unholy right now.

@Mauller
Copy link
Mauller commented Apr 2, 2025

All of these are included in the Fixes needed for Debug to work properly without asserting in the STL library.

But nice work on looking into things! The more help the merrier. :)

@bobtista
Copy link
Author
bobtista commented Apr 2, 2025

Already covered in #563

@bobtista bobtista closed this Apr 2, 2025
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.

4 participants

0