Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your question is quite vague, so it is quite hard to give a concrete answer. But maybe some ideas may help you.</p> <p>Every mail you receive gets some kind of unique id. This id could in your case derived from the sender and the timestamp of the received mail. Maybe you should write an <a href="http://msdn.microsoft.com/en-us/library/ms132151.aspx" rel="nofollow noreferrer"><code>IEqualityComparer</code></a> and consider this <a href="https://stackoverflow.com/questions/263400/what-is-the-best-algorithm-for-an-overridden-system-object-gethashcode"><code>GetHashCode</code> algorithm</a> for your implementation. Then you simply have to put all your mails into a <a href="http://msdn.microsoft.com/en-us/library/bb359438.aspx" rel="nofollow noreferrer"><code>new HashSet&lt;Email&gt;(MyEqualityComparer)</code></a> and when your method gets called you can simply check there if you already computed this message or not.</p> <p>If you don't like to store all mails within the <code>HashSet&lt;T&gt;</code> (maybe to improve memory footprint) you could call the <code>MyMailComparer.GetHashCode(email)</code> and put all the results into a <code>HashSet&lt;int&gt;</code> and discard the mail afterwards. But be aware that this could possible drop a new message cause it would be possible that two different messages could produce the same hash code, hence the need for the <code>Equals()</code> method to check in this case if both message are really equal, but this would make it necessary to keep the mails within the memory.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload