Skip to content

Commit 824a8e1

Browse files
committed
performance: useless call to getText
1 parent e6b25e7 commit 824a8e1

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

Diff for: lib/linter.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@ LinterTslint = (function (_super) {
2424
}
2525
LinterTslint.syntax = ['source.ts'];
2626
LinterTslint.prototype.lintFile = function (filePath, callback) {
27-
var contents, fileName;
2827
filePath = this.editor.buffer.file.path;
2928
if (!fs.existsSync(filePath))
3029
return callback([]);
31-
contents = this.editor.getText();
32-
fileName = path.basename(filePath);
30+
var fileName = path.basename(filePath);
3331
var errors = programManager.getErrorsForFileFiltered(filePath);
3432
var linterErrors = errors.map(function (err) { return {
3533
message: err.message,

Diff for: lib/linter.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,12 @@ LinterTslint = (function (_super) {
3838
(<any>LinterTslint).syntax = ['source.ts'];
3939

4040
LinterTslint.prototype.lintFile = function (filePath, callback: (errors: LinterError[]) => any) {
41-
var contents, fileName;
4241
filePath = this.editor.buffer.file.path;
4342

4443
// We refuse to work on files that are not on disk.
4544
if(!fs.existsSync(filePath)) return callback([]);
4645

47-
contents = this.editor.getText();
48-
fileName = path.basename(filePath);
46+
var fileName = path.basename(filePath);
4947

5048
var errors = programManager.getErrorsForFileFiltered(filePath);
5149
var linterErrors: LinterError[] = errors.map((err) => <LinterError>{

0 commit comments

Comments
 (0)