Skip to content

Conversation

@ipinak
Copy link
Contributor

@ipinak ipinak commented Jul 15, 2025

No description provided.

@rubenv
Copy link
Owner

rubenv commented Jul 15, 2025

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

@ipinak
Copy link
Contributor Author

ipinak commented Jul 15, 2025

@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
Owner

rubenv commented Jul 15, 2025

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:master Jul 16, 2025
5 checks passed
@rubenv
Copy link
Owner

rubenv commented Jul 16, 2025

Merged, thanks!

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