Author Topic: Find duplicates (and do it quickly)  (Read 13122 times)

0 Members and 1 Guest are viewing this topic.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8691
  • AKA Daniel
Re: Find duplicates (and do it quickly)
« Reply #30 on: November 26, 2010, 11:00:22 PM »
.........
Very minor optimization potential detected, if only for readability. May shave yet another few milliseconds off.
.........
..Or does the lambda look like Greek for anybody?

IMHO the best way to improve readability would to implement the necessary  operators  in the DuplicatePattern type +  IEqualityComparer,  IComparable..

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: Find duplicates (and do it quickly)
« Reply #31 on: November 27, 2010, 06:50:06 AM »
Quote
F# looks like Martian to me  laugh
I discovered Martian two weeks ago, and I think I enjoy it.

Thanks again Daniel, kaefer, xsfhlzh, and all others for your your C# and F# tricks :-)
Speaking English as a French Frog

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8691
  • AKA Daniel
Re: Find duplicates (and do it quickly)
« Reply #32 on: November 27, 2010, 08:44:08 AM »
Just tested the hashset.. while its not as fast as some of the previous entries, it's no slouch..

Code: [Select]
HashSet<DuplicatePattern> Patterns = new HashSet<DuplicatePattern>();
...
if (Patterns.Contains(dp))
          {
Well better get back to my C++ corner
« Last Edit: November 27, 2010, 08:49:07 AM by __assume »

Glenn R

  • Guest
Re: Find duplicates (and do it quickly)
« Reply #33 on: November 28, 2010, 01:47:21 PM »
Was thinking about a Hashset myself actually Dan...