diff options
author | Jan-Piet Mens <jp@mens.de> | 2017-07-19 12:02:27 +0200 |
---|---|---|
committer | Jan-Piet Mens <jp@mens.de> | 2017-07-19 12:02:27 +0200 |
commit | 97d57828301ef04ccd4a3c58ca9ce5a23038345e (patch) | |
tree | 318d8990b81863ba63be953d51f00085865147ac /src/org/traccar | |
parent | 2aaa4a5e00e801b9b310e42f538113dd83e60188 (diff) | |
download | traccar-server-97d57828301ef04ccd4a3c58ca9ce5a23038345e.tar.gz traccar-server-97d57828301ef04ccd4a3c58ca9ce5a23038345e.tar.bz2 traccar-server-97d57828301ef04ccd4a3c58ca9ce5a23038345e.zip |
remove redundant checks
Diffstat (limited to 'src/org/traccar')
-rw-r--r-- | src/org/traccar/api/resource/DeviceResource.java | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/org/traccar/api/resource/DeviceResource.java b/src/org/traccar/api/resource/DeviceResource.java index 0bf0aa45f..2957d623c 100644 --- a/src/org/traccar/api/resource/DeviceResource.java +++ b/src/org/traccar/api/resource/DeviceResource.java @@ -64,18 +64,15 @@ public class DeviceResource extends BaseResource { } ArrayList<Device> devices = new ArrayList<>(); - if (!uniqueIds.isEmpty()) { - for (String uniqueId : uniqueIds) { - Device device = Context.getDeviceManager().getDeviceByUniqueId(uniqueId); - Context.getPermissionsManager().checkDevice(getUserId(), device.getId()); - devices.add(device); - } + + for (String uniqueId : uniqueIds) { + Device device = Context.getDeviceManager().getDeviceByUniqueId(uniqueId); + Context.getPermissionsManager().checkDevice(getUserId(), device.getId()); + devices.add(device); } - if (!deviceIds.isEmpty()) { - for (Long deviceId : deviceIds) { - Context.getPermissionsManager().checkDevice(getUserId(), deviceId); - devices.add(Context.getDeviceManager().getDeviceById(deviceId)); - } + for (Long deviceId : deviceIds) { + Context.getPermissionsManager().checkDevice(getUserId(), deviceId); + devices.add(Context.getDeviceManager().getDeviceById(deviceId)); } return devices; } |