Click here to Skip to main content
15,902,743 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: A short way to detect if a list of KeyPairValues contains a specific Key Pin
satc19-Jun-15 11:33
satc19-Jun-15 11:33 
GeneralRe: A short way to detect if a list of KeyPairValues contains a specific Key Pin
Dave Kreskowiak19-Jun-15 12:52
mveDave Kreskowiak19-Jun-15 12:52 
GeneralRe: A short way to detect if a list of KeyPairValues contains a specific Key Pin
satc19-Jun-15 14:51
satc19-Jun-15 14:51 
GeneralRe: A short way to detect if a list of KeyPairValues contains a specific Key Pin
Dave Kreskowiak19-Jun-15 16:14
mveDave Kreskowiak19-Jun-15 16:14 
GeneralRe: A short way to detect if a list of KeyPairValues contains a specific Key Pin
satc19-Jun-15 16:49
satc19-Jun-15 16:49 
GeneralRe: A short way to detect if a list of KeyPairValues contains a specific Key Pin
Dave Kreskowiak19-Jun-15 17:26
mveDave Kreskowiak19-Jun-15 17:26 
GeneralRe: A short way to detect if a list of KeyPairValues contains a specific Key Pin
satc19-Jun-15 18:05
satc19-Jun-15 18:05 
GeneralRe: A short way to detect if a list of KeyPairValues contains a specific Key Pin
Dave Kreskowiak20-Jun-15 4:52
mveDave Kreskowiak20-Jun-15 4:52 
Define "not the best". That doesn't say anything at all about what's wrong with the approach. I can only guess at what you mean.

So, I go from the standpoint of performance. Every time this line is executed, the code has to build a collection of those keys from scratch and scan each key comparing to the input.

The way I do it, you're maintaining the list of keys constantly. It doesn't have to be built every time. I can also be improved for better lookup performance depending on requirements.
A guide to posting questions on CodeProject

Click this: Asking questions is a skill.
Seriously, do it.

Dave Kreskowiak

AnswerRe: A short way to detect if a list of KeyPairValues contains a specific Key Pin
Richard Deeming19-Jun-15 1:52
mveRichard Deeming19-Jun-15 1:52 
Questionvb.net 2010 datepicker Pin
sc steinhayse18-Jun-15 7:05
sc steinhayse18-Jun-15 7:05 
AnswerRe: vb.net 2010 datepicker Pin
Ralf Meier18-Jun-15 8:05
mveRalf Meier18-Jun-15 8:05 
AnswerRe: vb.net 2010 datepicker Pin
Dave Kreskowiak18-Jun-15 9:28
mveDave Kreskowiak18-Jun-15 9:28 
QuestionMimic a Undo/Redo on a VB.net + Database application Pin
satc18-Jun-15 0:41
satc18-Jun-15 0:41 
AnswerRe: Mimic a Undo/Redo on a VB.net + Database application Pin
Eddy Vluggen18-Jun-15 1:04
professionalEddy Vluggen18-Jun-15 1:04 
AnswerRe: Mimic a Undo/Redo on a VB.net + Database application Pin
Sascha Lefèvre18-Jun-15 1:30
professionalSascha Lefèvre18-Jun-15 1:30 
GeneralRe: Mimic a Undo/Redo on a VB.net + Database application Pin
Richard Deeming18-Jun-15 3:27
mveRichard Deeming18-Jun-15 3:27 
GeneralRe: Mimic a Undo/Redo on a VB.net + Database application Pin
Dave Kreskowiak18-Jun-15 4:20
mveDave Kreskowiak18-Jun-15 4:20 
GeneralRe: Mimic a Undo/Redo on a VB.net + Database application Pin
satc18-Jun-15 10:24
satc18-Jun-15 10:24 
GeneralRe: Mimic a Undo/Redo on a VB.net + Database application Pin
Sascha Lefèvre18-Jun-15 11:18
professionalSascha Lefèvre18-Jun-15 11:18 
GeneralRe: Mimic a Undo/Redo on a VB.net + Database application Pin
Dave Kreskowiak18-Jun-15 12:22
mveDave Kreskowiak18-Jun-15 12:22 
GeneralRe: Mimic a Undo/Redo on a VB.net + Database application Pin
satc18-Jun-15 12:45
satc18-Jun-15 12:45 
GeneralRe: Mimic a Undo/Redo on a VB.net + Database application Pin
Dave Kreskowiak18-Jun-15 13:19
mveDave Kreskowiak18-Jun-15 13:19 
GeneralRe: Mimic a Undo/Redo on a VB.net + Database application Pin
satc18-Jun-15 14:35
satc18-Jun-15 14:35 
GeneralRe: Mimic a Undo/Redo on a VB.net + Database application Pin
Dave Kreskowiak18-Jun-15 15:33
mveDave Kreskowiak18-Jun-15 15:33 
GeneralRe: Mimic a Undo/Redo on a VB.net + Database application Pin
satc18-Jun-15 17:04
satc18-Jun-15 17:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.