From 3d026fb046df51b176d1e08ae37957eb3073966c Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Tue, 28 Jan 2020 20:08:51 -0500 Subject: [PATCH] replace return with if --- java/src/processing/mode/java/PreprocService.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/java/src/processing/mode/java/PreprocService.java b/java/src/processing/mode/java/PreprocService.java index 75704d478..ea6bd2b8f 100644 --- a/java/src/processing/mode/java/PreprocService.java +++ b/java/src/processing/mode/java/PreprocService.java @@ -176,14 +176,15 @@ public class PreprocService { * Indicate to this service that the sketch code has changed. */ public void notifySketchChanged() { - if (!enabled) return; - synchronized (requestLock) { - if (preprocessingTask.isDone()) { - preprocessingTask = new CompletableFuture<>(); - // Register callback which executes all listeners - whenDone(this::fireListeners); + if (enabled) { + synchronized (requestLock) { + if (preprocessingTask.isDone()) { + preprocessingTask = new CompletableFuture<>(); + // Register callback which executes all listeners + whenDone(this::fireListeners); + } + requestQueue.offer(Boolean.TRUE); } - requestQueue.offer(Boolean.TRUE); } }