Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(730)

Unified Diff: sky/sdk/lib/rendering/paragraph.dart

Issue 1195113002: Improve stocks2 performance (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/lib/rendering/object.dart ('k') | sky/sdk/lib/widgets/widget.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/rendering/paragraph.dart
diff --git a/sky/sdk/lib/rendering/paragraph.dart b/sky/sdk/lib/rendering/paragraph.dart
index 6c2e70de6661fef340be82670c7e9edc33803940..1af7406e68ec31a0f3eab5c30f362752015ed4c0 100644
--- a/sky/sdk/lib/rendering/paragraph.dart
+++ b/sky/sdk/lib/rendering/paragraph.dart
@@ -24,6 +24,9 @@ class InlineText extends InlineBase {
return owner.createText(text);
}
+ bool operator ==(other) => other is InlineText && text == other.text;
+ int get hashCode => text.hashCode;
+
String toString([String prefix = '']) => '${prefix}InlineText: "${text}"';
}
@@ -45,6 +48,28 @@ class InlineStyle extends InlineBase {
return parent;
}
+ bool operator ==(other) {
+ if (identical(this, other))
+ return true;
+ if (other is! InlineStyle
+ || style != other.style
+ || children.length != other.children.length)
+ return false;
+ for (int i = 0; i < children.length; ++i) {
+ if (children[i] != other.children[i])
+ return false;
+ }
+ return true;
+ }
+
+ int get hashCode {
+ int value = 373;
+ value = 37 * value + style.hashCode;
+ for (InlineBase child in children)
+ value = 37 * value + child.hashCode;
+ return value;
+ }
+
String toString([String prefix = '']) {
List<String> result = [];
result.add('${prefix}InlineStyle:');
@@ -83,6 +108,8 @@ class RenderParagraph extends RenderBox {
InlineBase get inline => _inline;
void set inline (InlineBase value) {
+ if (_inline == value)
+ return;
_inline = value;
_layoutRoot.rootElement.setChild(_inline._toDOM(_document));
markNeedsLayout();
« no previous file with comments | « sky/sdk/lib/rendering/object.dart ('k') | sky/sdk/lib/widgets/widget.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698