| 757 | // is treated as a no-op. |
| 758 | template <typename T> |
| 759 | void discard(WeakFuture<T> reference) |
| 760 | { |
| 761 | Option<Future<T>> future = reference.get(); |
| 762 | if (future.isSome()) { |
| 763 | Future<T> future_ = future.get(); |
| 764 | future_.discard(); |
| 765 | } |
| 766 | } |
| 767 | |
| 768 | |
| 769 | // Helper for invoking Promise::discard in an onDiscarded callback |