From 416fc7283def0604467314d74a42f42753fa7064 Mon Sep 17 00:00:00 2001 From: Milot Mirdita Date: Fri, 10 Jan 2025 17:10:30 +0900 Subject: [PATCH] Allow printing arbitrary progress --- src/commons/Debug.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/commons/Debug.h b/src/commons/Debug.h index 8b7c79b1c..9c0ad6469 100644 --- a/src/commons/Debug.h +++ b/src/commons/Debug.h @@ -178,8 +178,13 @@ class Debug prevPrintedId = 0; } - void updateProgress(){ - size_t id = __sync_fetch_and_add(¤tPos, 1); + void updateProgress(size_t pos = SIZE_MAX){ + size_t id; + if (pos == SIZE_MAX) { + id = __sync_fetch_and_add(¤tPos, 1); + } else { + id = pos; + } // if no active terminal exists write dots if(interactive == false){ if(totalEntries==SIZE_MAX) {