Parcourir la source

[master] Update emptiness checks to be more efficient (cppcheck)

Reviewed by Thomas Markwalder on Jabber.
Mukund Sivaraman il y a 11 ans
Parent
commit
e4475a2cd9
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      src/hooks/dhcp/user_chk/subnet_select_co.cc

+ 2 - 2
src/hooks/dhcp/user_chk/subnet_select_co.cc

@@ -121,7 +121,7 @@ int subnet4_select(CalloutHandle& handle) {
         // Get subnet collection. If it's empty just bail nothing to do.
         const isc::dhcp::Subnet4Collection *subnets = NULL;
         handle.getArgument("subnet4collection", subnets);
-        if (subnets->size() == 0) {
+        if (subnets->empty()) {
             return 0;
         }
 
@@ -186,7 +186,7 @@ int subnet6_select(CalloutHandle& handle) {
         // Get subnet collection. If it's empty just bail nothing to do.
         const isc::dhcp::Subnet6Collection *subnets = NULL;
         handle.getArgument("subnet6collection", subnets);
-        if (subnets->size() == 0) {
+        if (subnets->empty()) {
             return 0;
         }