Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
NovemLinguae committed Mar 21, 2024
1 parent f3c3de8 commit 576404c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions UserTalkErasedSectionsDetector.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ErasedSectionsDetector {
}

/**
* Add a space to blank edit summaries. This is so the hyperlink can be clicked.
* Add a message to blank edit summaries. This is so the hyperlink can be clicked.
*/
addASpaceToBlankEditSummaries() {
this.revisions = this.revisions.map( function( revision ) {
Expand Down Expand Up @@ -91,8 +91,8 @@ class ErasedSectionsDetector {
}

filterForRevisionsByThisEditorOnly() {
let needle = this.mw.config.get( 'wgTitle' );
this.revisions = this.revisions.filter( ( revision ) => revision.user === needle );
let thisEditor = this.mw.config.get( 'wgTitle' );
this.revisions = this.revisions.filter( ( revision ) => revision.user === thisEditor );
}

filterOutArchiving() {
Expand All @@ -106,7 +106,7 @@ class ErasedSectionsDetector {
addDiffsToRevisions() {
let len = this.revisions.length;
let lastRevisionSize = this.revisions[len - 1].size;
// iterate backwards. need to store the older revision's size in a buffer to compute a diff.
// need to store the OLDER revision's size in a buffer to compute a diff, so iterate BACKWARDS
for ( let i = (len - 2); i >= 0; i-- ) {
let thisRevisionSize = this.revisions[i].size;
this.revisions[i].diff = thisRevisionSize - lastRevisionSize;
Expand Down

0 comments on commit 576404c

Please sign in to comment.