Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Link sessions together */
- FreeSessions = &Sessions[permutation[0]];
- LastFreeSession = &Sessions[permutation[NumSessionSlots-1]];
- for (i=0; i<NumSessionSlots-1; i++) {
- Sessions[permutation[i]].next = &Sessions[permutation[i+1]];
- }
- Sessions[permutation[NumSessionSlots-1]].next = NULL;
- free(permutation);
- } else {
- /* Link sessions together */
- FreeSessions = &Sessions[0];
- LastFreeSession = &Sessions[NumSessionSlots - 1];
- for (i=0; i<NumSessionSlots-1; i++) {
- Sessions[i].next = &Sessions[i+1];
- }
- Sessions[NumSessionSlots-1].next = NULL;
- }
Add Comment
Please, Sign In to add comment