Bug 58541 - CGIServlet and WebdavServlet code improvements
Summary: CGIServlet and WebdavServlet code improvements
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 8.0.x-trunk
Hardware: Macintosh Mac OS X 10.1
: P2 trivial (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-25 22:29 UTC by Anthony Whitford
Modified: 2015-11-03 09:18 UTC (History)
0 users



Attachments
Code improvements to two Servlet classes (6.40 KB, patch)
2015-10-25 22:29 UTC, Anthony Whitford
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Whitford 2015-10-25 22:29:17 UTC
Created attachment 33213 [details]
Code improvements to two Servlet classes

Noticed some opportunities:

'String.indexOf(char)' is faster than 'String.indexOf(string)'
'Integer.parseInt(s)' is more efficient than 'new Integer(s).intValue()'
'Integer.valueOf(i)' may be more efficient than 'new Integer(i)'
'Integer.toString(i)' is more efficient than 'Integer.valueOf(i).toString()'
Comment 1 Mark Thomas 2015-11-03 09:18:50 UTC
Issues fixed across the code base rather than just these 2 classes.

Fixed in trunk, 8.0.x (for 8.0.29 onwards) and 7.0.x (for 7.0.66 onwards).