• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Ugh....

Deeko

Lifer
You know you're bored when its 7am, you've been up all night, and you start looking through your code from your CS final project from the previous year.

void Mailbox::swap_node_(LinkedList<Mail> *Mail1, LinkedList<Mail> *Mail2)
{
LinkedList<Mail> *ptr1 = Mail1->get_previous_node();
LinkedList<Mail> *ptr2 = Mail2->get_previous_node();

if(ptr1 != Mail2 && ptr2 != Mail1)
{
if(ptr1 != NULL)
ptr1->link(Mail2);
else
Mail2->unlink();
if(ptr2 != NULL)
ptr2->link(Mail1);
else
Mail1->unlink();

ptr1 = Mail1->get_next_node();
Mail1->link(Mail2->get_next_node());
Mail2->link(ptr1);
}
else
{
if(ptr1 == Mail2)
{
Mail2->link(Mail1->get_next_node());
if(ptr2 != NULL)
ptr2->link(Mail1);
else
Mail1->unlink();
Mail1->link(Mail2);
}
else
{
Mail1->link(Mail2->get_next_node());
if(ptr1 != NULL)
ptr1->link(Mail2);
else
Mail2->unlink();
Mail2->link(Mail1);
}
}
}

man that was a bitch to code.
 
Back
Top