Branch: Tag:

2011-04-15

2011-04-15 11:50:31 by Martin Stjernholm <mast@lysator.liu.se>

Cleaned up some foreach (indices (..

Rev: server/base_server/cache.pike:1.144

1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2009, Roxen IS. - // $Id: cache.pike,v 1.143 2011/03/10 23:05:58 mast Exp $ + // $Id: cache.pike,v 1.144 2011/04/15 11:50:31 mast Exp $      // FIXME: Add argcache, imagecache & protcache   
1904:    if(max_persistence>t) {       clean: -  foreach(indices(session_buckets[-1]), string id) { +  foreach(session_buckets[-1]; string id; mixed data) {    if(session_persistence[id]<t) {    m_delete(session_buckets[-1], id);    m_delete(session_persistence, id);
1914:    if(session_buckets[i][id]) {    continue clean;    } -  if(objectp(session_buckets[-1][id])) { +  if(objectp(data)) {    m_delete(session_buckets[-1], id);    m_delete(session_persistence, id);    continue;    } -  store_session(id, session_buckets[-1][id], session_persistence[id]); +  store_session(id, data, session_persistence[id]);    m_delete(session_buckets[-1], id);    m_delete(session_persistence, id);    }
1936:    if(max_persistence>t) {    report_notice("Synchronizing session cache");    foreach(session_buckets, mapping(string:mixed) session_bucket) -  foreach(indices(session_bucket), string id) +  foreach(session_bucket; string id; mixed data)    if(session_persistence[id]>t) { -  store_session(id, session_bucket[id], session_persistence[id]); +  store_session(id, data, session_persistence[id]);    m_delete(session_persistence, id);    }    }