aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorJan-Piet Mens <jp@mens.de>2017-07-19 12:02:27 +0200
committerJan-Piet Mens <jp@mens.de>2017-07-19 12:02:27 +0200
commit97d57828301ef04ccd4a3c58ca9ce5a23038345e (patch)
tree318d8990b81863ba63be953d51f00085865147ac /src/org
parent2aaa4a5e00e801b9b310e42f538113dd83e60188 (diff)
downloadtrackermap-server-97d57828301ef04ccd4a3c58ca9ce5a23038345e.tar.gz
trackermap-server-97d57828301ef04ccd4a3c58ca9ce5a23038345e.tar.bz2
trackermap-server-97d57828301ef04ccd4a3c58ca9ce5a23038345e.zip
remove redundant checks
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/api/resource/DeviceResource.java19
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;
}