TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Robert
NA
3
0
Fast Lookup in List
Nov 24 2007 5:25 PM
Hi everyone,
i've got a problem using Generic.List. I'm currently writing a program which has to deal with a lot
of data stored in a Generic.List. I often need to search through the list to find out if a new item
is already stored in the list. This is no problem beacause of the Contains-Method. The problem
is this method is very slow and the processing has to be very fast. I've come up with writing an
anonymous function which does the seacrhing for me whcih is way faster. looking like this:
col = getNewColor();
if (!colors.Exists(delegate(Color c) { return c == col; }))
{
colors.Add(col);
}//
This is also not that fast, concerning what I need for my programm.
Is there any way
to speed-up a search through a list?
I appreciate any help.
Greetings LeRoi
Reply
Answers (
3
)
arraylist .Clear Help me plz
email or tel checking