Skip to content

Commit 3362c4f

Browse files
committed
2 parents 33e5861 + b85e77e commit 3362c4f

File tree

6 files changed

+22
-15
lines changed

6 files changed

+22
-15
lines changed

algorithm/sorting/cycle/basic/code.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ var writes = 0;
44
var pos;
55
var item;
66
var temp;
7-
for( cycleStart=0; cycleStart<=N-2; cycleStart++ ){
7+
for( var cycleStart=0; cycleStart<=N-2; cycleStart++ ){
88
item = D[cycleStart];
99
pos = cycleStart;
10-
for( i=cycleStart+1; i<=N-1; i++ ){
10+
for( var i=cycleStart+1; i<=N-1; i++ ){
1111
if( D[i]<item ){
1212
pos++;
1313
}
@@ -54,4 +54,4 @@ for( cycleStart=0; cycleStart<=N-2; cycleStart++ ){
5454
writes++;
5555
}
5656

57-
logger._print( 'Number of writes performed is ' + writes );
57+
logger._print( 'Number of writes performed is ' + writes );

js/server/helpers.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const setHashValue = (key, value)=> {
5858
}
5959

6060
const newHash = params.join('&');
61-
window.location.hash = '#' + newHash;
61+
window.location.hash = `#${newHash}`;
6262
};
6363

6464
const removeHashValue = (key) => {
@@ -75,19 +75,19 @@ const removeHashValue = (key) => {
7575
}
7676

7777
const newHash = params.join('&');
78-
window.location.hash = '#' + newHash;
78+
window.location.hash = `#${newHash}`;
7979
};
8080

8181
const setPath = (category, algorithm, file) => {
82-
const path = category ? category + (algorithm ? '/' + algorithm + (file ? '/' + file : '') : '') : '';
82+
const path = category ? category + (algorithm ? `/${algorithm}` + (file ? `/${file}` : '') : '') : '';
8383
setHashValue('path', path);
8484
};
8585

8686
const getPath = () => {
8787
const hash = getHashValue('path');
8888
if (hash) {
89-
const parts = hash.split('/');
90-
return {category: parts[0], algorithm: parts[1], file: parts[2]};
89+
const [ category, algorithm, file ] = hash.split('/');
90+
return { category, algorithm, file };
9191
} else {
9292
return false;
9393
}
@@ -101,4 +101,4 @@ module.exports = {
101101
removeHashValue,
102102
setPath,
103103
getPath
104-
};
104+
};

public/algorithm_visualizer.js

Lines changed: 10 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/algorithm_visualizer.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/algorithm_visualizer.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/algorithm_visualizer.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)