Jforrester has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/350964 )
Change subject: Transaction#isNoOp: Simple code is simple
......................................................................
Transaction#isNoOp: Simple code is simple
Change-Id: I61664bc58793262d1f1f5b4b98fe4ca4f86c4e98
---
M src/dm/ve.dm.Transaction.js
1 file changed, 8 insertions(+), 7 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor
refs/changes/64/350964/1
diff --git a/src/dm/ve.dm.Transaction.js b/src/dm/ve.dm.Transaction.js
index 604db67..6d3d7ac 100644
--- a/src/dm/ve.dm.Transaction.js
+++ b/src/dm/ve.dm.Transaction.js
@@ -231,14 +231,15 @@
ve.dm.Transaction.prototype.isNoOp = function () {
if ( this.operations.length === 0 ) {
return true;
- } else if ( this.operations.length === 1 ) {
- return this.operations[ 0 ].type === 'retain';
- } else if ( this.operations.length === 2 ) {
- return this.operations[ 0 ].type === 'retain' &&
- this.operations[ 1 ].type === 'retainMetadata';
- } else {
- return false;
}
+ if ( this.operations.length === 1 ) {
+ return this.operations[ 0 ].type === 'retain';
+ }
+ if ( this.operations.length === 2 ) {
+ return this.operations[ 0 ].type === 'retain' &&
this.operations[ 1 ].type === 'retainMetadata';
+ }
+
+ return false;
};
/**
--
To view, visit https://gerrit.wikimedia.org/r/350964
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I61664bc58793262d1f1f5b4b98fe4ca4f86c4e98
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Jforrester <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits