message: Remove unnecessary restore.
diff: @@ -49,14 +49,19 @@ function isDisplayableCulled(el, width, height) {
  }
  function isClipPathChanged(clipPaths, prevClipPaths) {
  - if (clipPaths === prevClipPaths) { // Can both be null or undefined
  - return false;
  - }
  + var clipPathsLen = clipPaths ? clipPaths.length : 0;
  + var prevClipPathsLen = prevClipPaths ? prevClipPaths.length : 0;
  - if (!clipPaths || !prevClipPaths || (clipPaths.length !== prevClipPaths.length)) {
  + if (clipPaths === prevClipPaths
  + // It is the same when being `null` or `undefined` or an empty array.
  + || (clipPathsLen === 0 && prevClipPathsLen === 0)
  + ) {
  + return;
  + }
  + if (!clipPaths || !prevClipPaths || (clipPathsLen !== prevClipPathsLen)) {
  return true;
  }
  - for (var i = 0; i < clipPaths.length; i++) {
  + for (var i = 0; i < clipPathsLen; i++) {
  if (clipPaths[i] !== prevClipPaths[i]) {
  return true;
  }
  @@ -506,21 +511,19 @@ Painter.prototype = {
  ) {
  var clipPaths = el.__clipPaths;
  + var prevElClipPaths = scope.prevElClipPaths;
  // Optimize when clipping on group with several elements
  - if (!scope.prevElClipPaths
  - || isClipPathChanged(clipPaths, scope.prevElClipPaths)
  - ) {
  + if (!prevElClipPaths || isClipPathChanged(clipPaths, prevElClipPaths)) {
  // If has previous clipping state, restore from it
  - if (scope.prevElClipPaths) {
  - currentLayer.ctx.restore();
  + if (prevElClipPaths && prevElClipPaths.length) {
  + ctx.restore();
  scope.prevElClipPaths = null;
  -
  // Reset prevEl since context has been restored
  scope.prevEl = null;
  }
  // New clipping state
  - if (clipPaths) {
  + if (clipPaths && clipPaths.length) {
  ctx.save();
  doClip(clipPaths, ctx);
  scope.prevElClipPaths = clipPaths;
  