Skip to content

Commit

Permalink
Use for..of instead of array loop (#408)
Browse files Browse the repository at this point in the history
Use Header.entries() returns an iterator not necessarily an Array.

See https://developer.mozilla.org/en-US/docs/Web/API/Headers/entries
  • Loading branch information
jorgemanrubia authored and SamSaffron committed Oct 17, 2019
1 parent 071027d commit a4aadd8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/html/includes.js
Expand Up @@ -851,8 +851,7 @@ var MiniProfiler = (function() {
try {
// look for x-mini-profile-ids
var entries = response.headers.entries();
for (var i = 0; i < entries.length; i++) {
var pair = entries[i];
for (var pair of entries) {
if (pair[0] && pair[0].toLowerCase() == "x-miniprofiler-ids") {
var ids = pair[1].split(",");
fetchResults(ids);
Expand Down

0 comments on commit a4aadd8

Please sign in to comment.