From c7a160f49248cdcd38f2d3ad125ed2b030758e5d Mon Sep 17 00:00:00 2001 From: Anton Berezhnyi Date: Fri, 13 Oct 2023 10:32:54 +0300 Subject: [PATCH] Optimize memory usage --- deletedScoresImporter.go | 2 +- editedLessonsImporter.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deletedScoresImporter.go b/deletedScoresImporter.go index 1d59c34..823b293 100644 --- a/deletedScoresImporter.go +++ b/deletedScoresImporter.go @@ -102,7 +102,7 @@ func (importer *DeletedScoresImporter) putIntoConfirmedIfSatisfy(event *dekanatE } func (importer *DeletedScoresImporter) pullDeletedScores() error { - lessonIds := make([]any, 0) + lessonIds := make([]any, 0, len(importer.eventQueue)) for _, event := range importer.eventQueue { lessonIds = append(lessonIds, event.GetLessonId()) } diff --git a/editedLessonsImporter.go b/editedLessonsImporter.go index 52d18ef..a698bdb 100644 --- a/editedLessonsImporter.go +++ b/editedLessonsImporter.go @@ -107,7 +107,7 @@ func (importer *EditedLessonsImporter) putIntoConfirmedIfSatisfy(event *dekanatE } func (importer *EditedLessonsImporter) pullEditedLessons() error { - lessonIds := make([]any, 0) + lessonIds := make([]any, 0, len(importer.eventQueue)) for _, event := range importer.eventQueue { lessonIds = append(lessonIds, event.GetLessonId()) }