[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[vidalia-svn] r1603: Apparently calling split() on an empty string does not retur (/ trunk/src/control)
Author: edmanm
Date: 2007-01-20 18:34:39 -0500 (Sat, 20 Jan 2007)
New Revision: 1603
Modified:
/
trunk/src/control/circuit.h
Log:
r1608@adrastea: edmanm | 2007-01-20 18:15:58 -0500
Apparently calling split() on an empty string does not return an empty list of
parts; it returns a non-empty list containing one empty element, even if you
say QString::SkipEmptyParts.
Property changes on:
___________________________________________________________________
svk:merge ticket from /vidalia/local [r1608] on 54b3572a-7227-0410-958f-53ecd705b71a
Modified: trunk/src/control/circuit.h
===================================================================
--- trunk/src/control/circuit.h 2007-01-20 22:42:39 UTC (rev 1602)
+++ trunk/src/control/circuit.h 2007-01-20 23:34:39 UTC (rev 1603)
@@ -72,9 +72,10 @@
/** Returns the path chosen for this circuit */
QString path() { return _path; }
/** Returns the length of the circuit's path. */
- uint length() { return _path.split(",").size(); }
+ uint length() { return hops().size(); }
/** Returns a list of hops on the path. */
- QStringList hops() { return _path.split(","); }
+ QStringList hops() { return _path.isEmpty() ? QStringList()
+ : _path.split(","); }
private:
quint64 _circId; /**< Circuit ID. */