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

Unified Diff: src/core/SkPath.cpp

Issue 22171002: Avoid counting verbs twice in SkPath::isEmpty() (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPath.cpp
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index d1e4d79179003a66c02cbbac0c5d49363f2d4194..875be9801e4d2910c2a757652abbb1c4a32395d3 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -380,11 +380,11 @@ bool SkPath::isEmpty() const {
bool SkPath::isLine(SkPoint line[2]) const {
int verbCount = fPathRef->countVerbs();
- int ptCount = fPathRef->countVerbs();
- if (2 == verbCount && 2 == ptCount) {
- if (kMove_Verb == fPathRef->atVerb(0) &&
- kLine_Verb == fPathRef->atVerb(1)) {
+ if (2 == verbCount) {
+ SkASSERT(kMove_Verb == fPathRef->atVerb(0));
+ if (kLine_Verb == fPathRef->atVerb(1)) {
+ SkASSERT(2 == fPathRef->countPoints());
if (line) {
const SkPoint* pts = fPathRef->points();
line[0] = pts[0];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698