Fix broken ManualExecutor
[folly.git] / folly / futures / ManualExecutor.h
index a37b92ff1fd553623d51faca96754d82a5d76e28..d4fb8db6bb606e86b534a6704fca223dbbd58610 100644 (file)
@@ -128,9 +128,11 @@ namespace folly {
       }
 
       bool operator<(ScheduledFunc const& b) const {
+        // Earlier-scheduled things must be *higher* priority
+        // in the max-based std::priority_queue
         if (time == b.time)
-          return ordinal < b.ordinal;
-        return time < b.time;
+          return ordinal > b.ordinal;
+        return time > b.time;
       }
 
       Func&& moveOutFunc() const {