From f50ba9ab4f6e74e4d472c9e2012dfdd29720dfe9 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 3 Dec 2015 18:19:02 +0100 Subject: [ticket/13454] Remove unused variables This is part 2 of the pr. PHPBB3-13454 --- phpBB/phpbb/tree/nestedset.php | 1 - 1 file changed, 1 deletion(-) (limited to 'phpBB/phpbb/tree') diff --git a/phpBB/phpbb/tree/nestedset.php b/phpBB/phpbb/tree/nestedset.php index 8490c7c299..63c59c0a3d 100644 --- a/phpBB/phpbb/tree/nestedset.php +++ b/phpBB/phpbb/tree/nestedset.php @@ -391,7 +391,6 @@ abstract class nestedset implements \phpbb\tree\tree_interface throw new \OutOfBoundsException($this->message_prefix . 'INVALID_PARENT'); } - $diff = sizeof($move_items) * 2; $sql_exclude_moved_items = $this->db->sql_in_set($this->column_item_id, $move_items, true); $this->db->sql_transaction('begin'); -- cgit v1.2.1 From 266576c6a4224f4b803040c678020e825a1510b5 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 4 Dec 2015 11:50:39 +0100 Subject: [ticket/13454] Remove unused variables Part 4 PHPBB3-13454 --- phpBB/phpbb/tree/nestedset.php | 1 - 1 file changed, 1 deletion(-) (limited to 'phpBB/phpbb/tree') diff --git a/phpBB/phpbb/tree/nestedset.php b/phpBB/phpbb/tree/nestedset.php index 63c59c0a3d..7149513fd9 100644 --- a/phpBB/phpbb/tree/nestedset.php +++ b/phpBB/phpbb/tree/nestedset.php @@ -489,7 +489,6 @@ abstract class nestedset implements \phpbb\tree\tree_interface throw new \OutOfBoundsException($this->message_prefix . 'INVALID_PARENT'); } - $diff = sizeof($move_items) * 2; $sql_exclude_moved_items = $this->db->sql_in_set($this->column_item_id, $move_items, true); $this->db->sql_transaction('begin'); -- cgit v1.2.1 From f8fbe3793680af1dae2db2829cfc84068831c52f Mon Sep 17 00:00:00 2001 From: rxu Date: Wed, 28 Jun 2017 00:58:03 +0700 Subject: [ticket/14972] replace all occurrences of sizeof() with the count() PHPBB3-14972 --- phpBB/phpbb/tree/nestedset.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/tree') diff --git a/phpBB/phpbb/tree/nestedset.php b/phpBB/phpbb/tree/nestedset.php index 7149513fd9..c02deaebf4 100644 --- a/phpBB/phpbb/tree/nestedset.php +++ b/phpBB/phpbb/tree/nestedset.php @@ -706,7 +706,7 @@ abstract class nestedset implements \phpbb\tree\tree_interface { $acquired_new_lock = $this->acquire_lock(); - $diff = sizeof($subset_items) * 2; + $diff = count($subset_items) * 2; $sql_subset_items = $this->db->sql_in_set($this->column_item_id, $subset_items); $sql_not_subset_items = $this->db->sql_in_set($this->column_item_id, $subset_items, true); @@ -746,7 +746,7 @@ abstract class nestedset implements \phpbb\tree\tree_interface */ protected function prepare_adding_subset(array $subset_items, array $new_parent) { - $diff = sizeof($subset_items) * 2; + $diff = count($subset_items) * 2; $sql_not_subset_items = $this->db->sql_in_set($this->column_item_id, $subset_items, true); $set_left_id = $this->db->sql_case($this->column_left_id . ' > ' . (int) $new_parent[$this->column_right_id], $this->column_left_id . ' + ' . $diff, $this->column_left_id); -- cgit v1.2.1 From 27a24d0a677a3f1fb0dcf2393859eb37fe3bc0c3 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 25 Dec 2017 19:20:02 +0100 Subject: [ticket/15055] Try using build matrix PHPBB3-15055 --- phpBB/phpbb/tree/nestedset.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/tree') diff --git a/phpBB/phpbb/tree/nestedset.php b/phpBB/phpbb/tree/nestedset.php index 7149513fd9..68485d04be 100644 --- a/phpBB/phpbb/tree/nestedset.php +++ b/phpBB/phpbb/tree/nestedset.php @@ -533,7 +533,7 @@ abstract class nestedset implements \phpbb\tree\tree_interface $row = $this->db->sql_fetchrow($result); $this->db->sql_freeresult($result); - $diff = ' + ' . ($row[$this->column_right_id] - (int) $item[$this->column_left_id] + 1); + $diff = ' + ' . ((int) $row[$this->column_right_id] - (int) $item[$this->column_left_id] + 1); } $sql = 'UPDATE ' . $this->table_name . ' -- cgit v1.2.1