From 4b0e930363fbafd1780b146ec9e55edb961fc919 Mon Sep 17 00:00:00 2001 From: hanchon Date: Sun, 27 Aug 2023 16:48:45 +0200 Subject: [PATCH 1/2] fix: remove hardcoded array length --- x/indexer/data/database.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/indexer/data/database.go b/x/indexer/data/database.go index 2f4fbab..536176b 100644 --- a/x/indexer/data/database.go +++ b/x/indexer/data/database.go @@ -250,7 +250,7 @@ func (db *Database) GetRows(table *Table) map[string][]Field { // TODO: improve this because it's expensive ret := map[string][]Field{} for k, v := range *table.Rows { - temp := [4]Field{} + temp := make([]Field, len(v)) copy(temp[:], v) ret[k] = temp[:] } From 6894f0bfd085a3ded97eac44e8a37f0b48168593 Mon Sep 17 00:00:00 2001 From: hanchon Date: Sun, 27 Aug 2023 17:41:12 +0200 Subject: [PATCH 2/2] fix: linter issues --- x/indexer/data/database.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/indexer/data/database.go b/x/indexer/data/database.go index 536176b..abdbcb1 100644 --- a/x/indexer/data/database.go +++ b/x/indexer/data/database.go @@ -251,8 +251,8 @@ func (db *Database) GetRows(table *Table) map[string][]Field { ret := map[string][]Field{} for k, v := range *table.Rows { temp := make([]Field, len(v)) - copy(temp[:], v) - ret[k] = temp[:] + copy(temp, v) + ret[k] = temp } for _, v := range db.UnconfirmedTransactions {