mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-31 07:12:49 -04:00
Fixed performance problem with duplicate user code problem annotations.
This commit is contained in:
parent
43a49b3e6f
commit
32c45b80a9
1 changed files with 3 additions and 0 deletions
|
@ -326,7 +326,10 @@ module.exports = class SpellView extends View
|
|||
isCast = not _.isEmpty(aether.metrics) or _.some aether.problems.errors, {type: 'runtime'}
|
||||
@problems = []
|
||||
annotations = []
|
||||
seenProblemKeys = {}
|
||||
for aetherProblem, problemIndex in aether.getAllProblems()
|
||||
continue if aetherProblem.userInfo.key of seenProblemKeys
|
||||
seenProblemKeys[aetherProblem.userInfo.key] = true
|
||||
@problems.push problem = new Problem aether, aetherProblem, @ace, isCast and problemIndex is 0, isCast
|
||||
annotations.push problem.annotation if problem.annotation
|
||||
@aceSession.setAnnotations annotations
|
||||
|
|
Loading…
Add table
Reference in a new issue