mirror of
https://github.com/pi-hole/web.git
synced 2025-12-23 20:28:28 +00:00
Use Array.map() instead of looping over elements and pushing the content to a new array
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -313,16 +313,7 @@ $(document).ready(function() {
|
||||
"ajax": {
|
||||
"url": APIstring,
|
||||
"error": handleAjaxError,
|
||||
"dataSrc": function(data){
|
||||
var new_data = new Array();
|
||||
for(obj of data.data)
|
||||
{
|
||||
obj[0] *= parseInt(1e6);
|
||||
obj[0] += dataIndex++;
|
||||
new_data.push(obj);
|
||||
}
|
||||
return new_data;
|
||||
}
|
||||
"dataSrc": function(data){ return data.data.map(function(x){ x[0] = x[0]*1e6+(dataIndex++); return x; }); }
|
||||
},
|
||||
"autoWidth" : false,
|
||||
"processing": true,
|
||||
|
||||
Reference in New Issue
Block a user