Skip to content

Commit 8e240b7

Browse files
committed
Code cleanup
1 parent 75e34f9 commit 8e240b7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/lib/contract/contract-comment.es6

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function updateComment(contract, commentLines, location) {
4747
} else map[key] = obj;
4848
return map;
4949
}, {});
50-
50+
// update params if changed
5151
if (newCommentsParams.length) {
5252
for (let k in oldCommentsMap) {
5353
if (!k in newCommentsMap) {
@@ -72,15 +72,13 @@ function updateComment(contract, commentLines, location) {
7272
newCommentsParams,
7373
isTab(contract.getOriginalLineAt(location.start.line - 1))
7474
);
75-
for (let c of newCommentsParams.reverse()) {
76-
let newComment = c;
77-
let oldCommentParamName = c.trim().split(' ')[2];
75+
for (let newComment of newCommentsParams.reverse()) {
76+
let oldCommentParamName = newComment.trim().split(' ')[2];
7877
let savedComment = savedComments[oldCommentParamName];
7978
if (typeof savedComment !== "undefined") {
8079
newComment = newComment + " " + savedComment;
8180
}
8281
contract.insertLinesBeforeWithoutCalculatingAndAddingOffset(newComment.split(), firstCommentLine);
83-
8482
}
8583
contract.addOffset(firstCommentLine, newCommentsParams.length - oldCommentsParams.length);
8684
return true;

0 commit comments

Comments
 (0)