equal
deleted
inserted
replaced
294 * This routine performs lazy instantiation of the operator symbols supported by this helper. |
294 * This routine performs lazy instantiation of the operator symbols supported by this helper. |
295 * After initialization is done, the suppliers are cleared, to free up memory. |
295 * After initialization is done, the suppliers are cleared, to free up memory. |
296 */ |
296 */ |
297 private OperatorSymbol[] initOperators() { |
297 private OperatorSymbol[] initOperators() { |
298 OperatorSymbol[] operators = operatorSuppliers.stream() |
298 OperatorSymbol[] operators = operatorSuppliers.stream() |
299 .map(op -> op.get()) |
299 .map(Supplier::get) |
300 .toArray(OperatorSymbol[]::new); |
300 .toArray(OperatorSymbol[]::new); |
301 alternatives = Optional.of(operators); |
301 alternatives = Optional.of(operators); |
302 operatorSuppliers = null; //let GC do its work |
302 operatorSuppliers = null; //let GC do its work |
303 return operators; |
303 return operators; |
304 } |
304 } |