Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 94543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:31:05+00:00 2026-05-10T23:31:05+00:00

I see that over on this question LINQy way to check if any objects

  • 0

I see that over on this question LINQy way to check if any objects in a collection have the same property value there is a request to say how to do something using LINQ to see if a property matches in a collection. However, is this the fastest reasonable process by which to do this? I will be deploying something that requires a certain amount of resource management, and I want the application to be as responsive as can be, without making the code terribly hard to decipher when someone else, or myself come back to it later.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T23:31:06+00:00Added an answer on May 10, 2026 at 11:31 pm

    However, is this the fastest reasonable process by which to do this?

    I’d guess that a fast way (perhaps the fastest way) to do it might be to add all the objects into a Dictionary or a HashSet, using the property as the key field: a method like HashSet.Add has a return code which tells you whether this property value has already been added. For example:

    static bool containsDuplicate(Container<Foo> fooCollection) {     //create the hash set     HashSet<Bar> hashSet = new HashSet<Bar>();     //for each object to be tested     foreach (Foo foo in fooCollection)     {         //get the interesting object property         Bar propertyValue = fooCollection.bar;         //see whather we've already seen this property value         if (!hashSet.Add(propertyValue))         {             //duplicate detected             return true;         }     }     //no duplicate detected     return false; } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I see that this is the same question as Making cmake print commands before
I usually see this question asked the other way, such as Must every ivar
I see this question asked all over the internet, and I've tried following them
I have been looking all over the Internet for an answer to this question
I have been asked this question, but failed to find an article that describe
We have an app with a long polling scheme over HTTP (although this question
I looked over the suggested list, and didn't see anything that seemed to fit
Is it so that svcutil tool is recommended over xsd tool? I didn't see
I see that most of big websites are returning javascript objects instead of pure
I see that many people get this error, but their situations all appear a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.