You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by ad...@apache.org on 2021/01/04 13:09:18 UTC

[roller] 02/05: Fixed: sonarqube issue - 'i' is already defined Variables and functions should not be redeclared Used let to provide let scope to it

This is an automated email from the ASF dual-hosted git repository.

adityasharma pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/roller.git

commit 0001a2aada47b5c264ca1e2804820e9df472c0ec
Author: Aditya Sharma <ad...@apache.org>
AuthorDate: Mon Jan 4 17:33:02 2021 +0530

    Fixed: sonarqube issue - 'i' is already defined
    Variables and functions should not be redeclared
    Used let to provide let scope to it
---
 app/src/main/webapp/roller-ui/scripts/ajax-user.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/src/main/webapp/roller-ui/scripts/ajax-user.js b/app/src/main/webapp/roller-ui/scripts/ajax-user.js
index 49715b3..bc3ca60 100644
--- a/app/src/main/webapp/roller-ui/scripts/ajax-user.js
+++ b/app/src/main/webapp/roller-ui/scripts/ajax-user.js
@@ -75,13 +75,13 @@ function sendUserRequest(url) {
 function handleUserResponse() {
     if (http.readyState === 4) {
         var userList = document.getElementById("userList");
-        for (var i = userList.options.length; i >= 0; i--) {
+        for (let i = userList.options.length; i >= 0; i--) {
             userList.options[i] = null;
         }
         var data = http.responseText;
         if (data.indexOf("\n") !== -1) {
             var lines = data.split('\n');
-            for (var i = 0; i < lines.length; i++) {
+            for (let i = 0; i < lines.length; i++) {
                 if (lines[i].indexOf(',') !== -1) {
                    var userArray = lines[i].split(',');
                    userList.options[userList.length] =