Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: table.remove function does not work with random indexes #1801

Merged
merged 2 commits into from
Nov 13, 2023

Conversation

luanluciano93
Copy link
Contributor

A função table.remove não funciona com índices aleatórios ..

Ela funcionaria apenas em tabelas com índices sequenciais:
tabela = { [1] = "teste1", [2] = "teste2", }
table.remove(tabela, 1)

Ou funcionaria em tabelas sem os índices:
tabela = { {"teste1"}, {"teste2"} }
table.remove(tabela, 1)

Neste caso do globalStorageTable onde os índices são as chaves, e elas são aleatórias deve apenas definir o nil ...
tabela = { [999] = "teste1", [12345] = "teste2", }
tabela[999] = nil

@dudantas dudantas changed the title fix: table.remove function does not work with random indices fix: table.remove function does not work with random indexes Nov 13, 2023
@dudantas dudantas merged commit 9620fde into opentibiabr:main Nov 13, 2023
@dudantas dudantas deleted the fixGlobalStorage branch November 13, 2023 07:51
elsongabriel pushed a commit to elsongabriel/canary that referenced this pull request Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants