From: Tsuda Kageyu Date: Thu, 18 Feb 2016 05:29:17 +0000 (+0900) Subject: Add a TODO comment in ByteVector::replace(). X-Git-Tag: v1.11beta2~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=887f3b28e552bde425be7b8a8a2459e3e9066c11;p=taglib Add a TODO comment in ByteVector::replace(). --- diff --git a/taglib/toolkit/tbytevector.cpp b/taglib/toolkit/tbytevector.cpp index 22ce2d4f..62f0fbef 100644 --- a/taglib/toolkit/tbytevector.cpp +++ b/taglib/toolkit/tbytevector.cpp @@ -489,6 +489,8 @@ ByteVector &ByteVector::replace(char oldByte, char newByte) ByteVector &ByteVector::replace(const ByteVector &pattern, const ByteVector &with) { + // TODO: This takes O(n!) time in the worst case. Rewrite it to run in O(n) time. + if(pattern.size() == 0 || pattern.size() > size()) return *this;