about summary refs log tree commit diff
path: root/src/nix/progress-bar.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-08-28T12·30+0200
committerEelco Dolstra <edolstra@gmail.com>2017-08-28T12·30+0200
commite681b1f064f88b46cd75d374937bd07e5d6e95d1 (patch)
tree2306fd0cec9a10bb9a5e14e0731558833dbc6cb1 /src/nix/progress-bar.cc
parent8fff3e7bb50377e48fb9c672e6551abae0fdf03d (diff)
Simplify
Diffstat (limited to 'src/nix/progress-bar.cc')
-rw-r--r--src/nix/progress-bar.cc27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/nix/progress-bar.cc b/src/nix/progress-bar.cc
index 054127f6277e..70dbfd4e5964 100644
--- a/src/nix/progress-bar.cc
+++ b/src/nix/progress-bar.cc
@@ -192,21 +192,6 @@ public:
         update(*state);
     }
 
-    void setExpected(ActivityId act, ActivityType type, uint64_t expected) override
-    {
-        auto state(state_.lock());
-
-        auto i = state->its.find(act);
-        assert(i != state->its.end());
-        ActInfo & actInfo = *i->second;
-        auto & j = actInfo.expectedByType[type];
-        state->activitiesByType[type].expected -= j;
-        j = expected;
-        state->activitiesByType[type].expected += j;
-
-        update(*state);
-    }
-
     void result(ActivityId act, ResultType type, const std::vector<Field> & fields) override
     {
         auto state(state_.lock());
@@ -258,6 +243,18 @@ public:
             actInfo.failed = getI(fields, 3);
             update(*state);
         }
+
+        else if (type == resSetExpected) {
+            auto i = state->its.find(act);
+            assert(i != state->its.end());
+            ActInfo & actInfo = *i->second;
+            auto type = (ActivityType) getI(fields, 0);
+            auto & j = actInfo.expectedByType[type];
+            state->activitiesByType[type].expected -= j;
+            j = getI(fields, 1);
+            state->activitiesByType[type].expected += j;
+            update(*state);
+        }
     }
 
     void update()