From 5aff87a3fd944604d9aefe902f322e39cd772e86 Mon Sep 17 00:00:00 2001 From: s-renier-taonix-fr Date: Mon, 13 Feb 2023 10:54:06 +0800 Subject: [PATCH] Optim : Loop can be replace with 'in_array()' --- src/nusoap.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/nusoap.php b/src/nusoap.php index 3f4e44a..7edd071 100755 --- a/src/nusoap.php +++ b/src/nusoap.php @@ -5405,11 +5405,10 @@ function getOperationData($operation, $bindingType = 'soap') if ($portData['bindingType'] == $bindingType) { // get binding //foreach($this->bindings[ $portData['binding'] ]['operations'] as $bOperation => $opData) { - foreach (array_keys($this->bindings[$portData['binding']]['operations']) as $bOperation) { - // note that we could/should also check the namespace here - if ($operation == $bOperation) { - return $this->bindings[$portData['binding']]['operations'][$operation]; - } + // note that we could/should also check the namespace here + if (in_array ($operation, array_keys ($this->bindings[$portData['binding']]['operations']))) + { + return $this->bindings[$portData['binding']]['operations'][$operation]; } } }