   # Internal: Performs the actual {MinimapElement} update.
   update: ->
     return unless @attached and @isVisible() and @minimap?
-    @minimap.enableCache()
-
-    visibleAreaLeft = @minimap.getTextEditorScaledScrollLeft()
-    visibleAreaTop = @minimap.getTextEditorScaledScrollTop() - @minimap.getScrollTop()
+    minimap = @minimap
+    minimap.enableCache()
+
+    visibleAreaLeft = minimap.getTextEditorScaledScrollLeft()
+    visibleAreaTop = minimap.getTextEditorScaledScrollTop() - minimap.getScrollTop()
     visibleWidth = Math.min(@canvas.width / devicePixelRatio, @width)
 
     if @adjustToSoftWrap and @flexBasis

    if SPEC_MODE
      @applyStyles @visibleArea,
        width: visibleWidth + 'px'
        height: @minimap.getTextEditorScaledHeight() + 'px'
        top: visibleAreaTop + 'px'
        left: visibleAreaLeft + 'px'
    else
      @applyStyles @visibleArea,
        width: visibleWidth + 'px'
        height: @minimap.getTextEditorScaledHeight() + 'px'
        transform: @makeTranslate(visibleAreaLeft, visibleAreaTop)

    @applyStyles @controls,
      width: visibleWidth + 'px'

    canvasTop = @minimap.getFirstVisibleScreenRow() * @minimap.getLineHeight() - @minimap.getScrollTop()

    canvasTransform = @makeTranslate(0, canvasTop)
    canvasTransform += " " + @makeScale(1 / devicePixelRatio) if devicePixelRatio isnt 1

          height: indicatorHeight + 'px'
          transform: @makeTranslate(0, indicatorScroll)

      @disposeScrollIndicator() if not minimap.canScroll()

    @updateCanvas()
    minimap.clearCache()

  # Defines whether to render the code highlights or not.
  #
