Skip to content

use fixed length array - #288

Merged
rubenv merged 2 commits into
rubenv:masterfrom
ipinak:master
Jul 16, 2025
Merged

use fixed length array#288
rubenv merged 2 commits into
rubenv:masterfrom
ipinak:master

Conversation

@ipinak

Copy link
Copy Markdown
Contributor

No description provided.

@rubenv

Copy link
Copy Markdown
Owner

@ipinak do you have that many migrations that this makes any noticeable difference?

@ipinak

Copy link
Copy Markdown
ContributorAuthor

@ipinak do you have that many migrations that this makes any noticeable difference?

TBH, not a big issue. It just avoids reallocation since you already know the exact length of the array.

@rubenv

Copy link
Copy Markdown
Owner

Cleaner to use existingMigrations := make([]*Migration, 0, len(migrationRecords)) so you can still use append in such cases. Also less error-prone.

@rubenv
rubenv merged commit e2b42d1 into rubenv:masterJul 16, 2025
5 checks passed
@rubenv

Copy link
Copy Markdown
Owner

Merged, thanks!

Sign up for freeto 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

@ipinak@rubenv