Bug 176085 - Utils.shortenText could be optimized
Summary: Utils.shortenText could be optimized
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 3.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.3 M7   Edit
Assignee: Michael Valenta CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-03-01 14:35 EST by Philip K. Warren CLA
Modified: 2007-03-28 08:55 EDT (History)
0 users

See Also:


Attachments
Patch v1 (1.57 KB, patch)
2007-03-01 14:56 EST, Philip K. Warren CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philip K. Warren CLA 2007-03-01 14:35:17 EST
The current version iterates over the entire string passed in, calling String.substring() twice each time through the loop. It can be optimized by just taking the first portion of the string, the ellipsis, and the last portion of the string.
Comment 1 Philip K. Warren CLA 2007-03-01 14:56:50 EST
Created attachment 60109 [details]
Patch v1

Improves performance of Utils.shortenText().
Comment 2 Michael Valenta CLA 2007-03-28 08:55:46 EDT
Patch released to Head. Thanks.