Completing the scripts with the latest devices and features.
[pingpong.git] / Code / Projects / PacketLevelSignatureExtractor / src / main / java / edu / uci / iotproject / util / PcapPacketUtils.java
index 2601dc1cc35528e76d2857ca5dd2cf74b07b3509..edfbb9cbe98ccb53692b5a1dab1e8ef83dcd0416 100644 (file)
@@ -670,6 +670,12 @@ public final class PcapPacketUtils {
                                                        PcapPacket lowerBound, PcapPacket upperBound) {
 
         List<PcapPacket> listBounds = new ArrayList<>();
+        // Just return the lower and upper bounds when their values are the same --- faster
+        if (lowerBound.length() == upperBound.length()) {
+            listBounds.add(0, lowerBound);
+            listBounds.add(1, upperBound);
+            return listBounds;
+        }
         // Iterate over PcapPacket one by one
         for(List<List<PcapPacket>> listOfListPcapPacket : corePointRange) {
             List<PcapPacket> listCorePointLowerBound = listOfListPcapPacket.get(0);