Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@BuckarooBanzay
Copy link
Member

@BuckarooBanzay BuckarooBanzay commented Jun 6, 2023

see discussion in #97 and #98 (the break just breaks out of the inner loop, the messages still get iterated over)

for example this player-entry here:

local entry = {
 inbox = {
  { id = "a" },
  { id = "b" },
  { id = "c" }
 }
}

and if you want to delete messages with the following msg_id's:

msg_ids = { "c", "b" }

The mail with id c will get matched first and removed, after that the inbox looks like this:

inbox = {
  { id = "a" },
  { id = "b" }
}

But the inner loop still continues with the exact same i value and tries to dereference inbox[3] (which it does not find)

The break ensures that the i iterator value is actually sane and does point to a valid entry.

@BuckarooBanzay BuckarooBanzay requested a review from Athozus June 6, 2023 05:04
@Athozus
Copy link
Member

Athozus commented Jun 6, 2023

Ok @BuckarooBanzay sorry for being too fast, my bad. Should be better now, I'm ok for a merge.

Copy link
Member

@Athozus Athozus left a comment

Choose a reason for hiding this comment

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

Good, my changes weren't useful.

@BuckarooBanzay BuckarooBanzay merged commit de07f6b into master Jun 6, 2023
@BuckarooBanzay BuckarooBanzay mentioned this pull request Jun 14, 2023
@Athozus Athozus deleted the BuckarooBanzay-patch-1 branch June 17, 2023 13:53
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.

3 participants