From c87ae97113883b39e2c05958d6a79891bec44bc4 Mon Sep 17 00:00:00 2001 From: dam Date: Sat, 19 Aug 2023 02:48:30 +0100 Subject: Selected implementation for update_total_times. --- ttt.jai | 92 +---------------------------------------------------------------- 1 file changed, 1 insertion(+), 91 deletions(-) diff --git a/ttt.jai b/ttt.jai index 15b5a66..f51fdb5 100644 --- a/ttt.jai +++ b/ttt.jai @@ -448,107 +448,17 @@ update_times :: (db: *Database) { } } -x_count: s64 = 0; -x_average: float64 = 0.0; - - // Recalculates database totals. update_total_times :: (db: *Database) { assert(db != null, ASSERT_NOT_NULL, "db"); - // print(">>>xpto: %<<<\n", totals); - // print(">>>sizeA: %<<<\n", size_of([7] s64)); - // print(">>>sizeB: %<<<\n", NUM_WEEK_DAYS * size_of(s64)); - // print(">>>sizeC: %<<<\n", size_of(type_of(db.total_times))); - // Initialize(*totals.data); - // print(">>>xpto: %<<<\n", totals); - // totals.data = .[]; - - // TODO WIP - // Check what size there is for a [..] s64... - - print(">>%<<", db.total_times.count); - // memset(totals.data, 0, db.total_times.count * size_of(s64)); - // memset(db.total_times.data, 0, size_of(type_of(db.total_times))); - - for xpto: 1..100 { + for *total: db.total_times { <