From 887f3b28e552bde425be7b8a8a2459e3e9066c11 Mon Sep 17 00:00:00 2001 From: Tsuda Kageyu Date: Thu, 18 Feb 2016 14:29:17 +0900 Subject: [PATCH] Add a TODO comment in ByteVector::replace(). --- taglib/toolkit/tbytevector.cpp | 2 ++ 1 file changed, 2 insertions(+) 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; -- 2.50.1