diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2019-05-13 19:18:52 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2019-05-13 19:18:52 (GMT) |
commit | 45ba71921feace0e295cafb0903a1007646528f3 (patch) | |
tree | 265ba4dc415b3663731b5f24efa8481ba4e4fb6c /src | |
parent | 546443fde85b99beb613c9eced1984a079bb171f (diff) | |
download | Doxygen-45ba71921feace0e295cafb0903a1007646528f3.zip Doxygen-45ba71921feace0e295cafb0903a1007646528f3.tar.gz Doxygen-45ba71921feace0e295cafb0903a1007646528f3.tar.bz2 |
Simplified code a bit
Diffstat (limited to 'src')
-rw-r--r-- | src/docparser.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/docparser.cpp b/src/docparser.cpp index 71b2d78..90ace3f 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -2919,21 +2919,11 @@ DocImage::DocImage(DocNode *parent,const HtmlAttribList &attribs,const QCString bool DocImage::isSVG() const { - QCString loc_name; - if (m_url.isEmpty()) - { - loc_name = m_name; - } - else - { - loc_name = m_url; - } - int fnd = loc_name.find('?'); - if (fnd != -1) - { - loc_name = loc_name.left(fnd); - } - return loc_name.right(4)==".svg"; + QCString locName = m_url.isEmpty() ? m_name : m_url; + int len = locName.length(); + int fnd = locName.find('?'); // ignore part from ? until end + if (fnd!=-1) fnd=len; + return fnd>=4 && locName.mid(fnd-4,4)==".svg"; } void DocImage::parse() |