Created
May 6, 2015 20:56
-
-
Save anxiousmodernman/574684639d9bedfac859 to your computer and use it in GitHub Desktop.
Flippin Bits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* For posterity, since I'm always looking this up. | |
*/ | |
private void EnsureListingIsVisble(string key) | |
{ | |
// turn off 2 + 8 bits | |
Listing listing = ListingsToAuditDictionary[key]; | |
listing.IDX = listing.IDX ^ (int)ListingIdxEnum.NotSignedInNoListing; // 2 | |
listing.IDX = listing.IDX ^ (int)ListingIdxEnum.SignedInNoListing; // 8 | |
ListingsToUpdate.Add(listing); | |
} | |
private void EnsureListingNotVisible(string sourceKeyFromDb) | |
{ | |
// turn on 2 + 8 bits | |
Listing listing = ListingsToAuditDictionary[sourceKeyFromDb]; | |
listing.IDX = listing.IDX | (int)ListingIdxEnum.NotSignedInNoListing; // 2 | |
listing.IDX = listing.IDX | (int)ListingIdxEnum.SignedInNoListing; // 8 | |
ListingsToUpdate.Add(listing); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment