Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2138 for trunk/sources


Ignore:
Timestamp:
07/06/09 19:53:43 (15 years ago)
Author:
gkronber
Message:

Minor code improvement. #286 (Variable-usage diagrams for the CEDMA frontend)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CEDMA.DB/3.3/Store.cs

    r2137 r2138  
    4141    private SemWeb.Store store;
    4242    private object bigLock = new object();
     43    private SemWeb.Store cachedStore;
     44
    4345    public Store(string connectionString) {
    4446      lock (bigLock) {
     
    7577        SemWeb.N3Reader n3Reader = new SemWeb.N3Reader(new StringReader(query));
    7678        SemWeb.Query.GraphMatch matcher = new SemWeb.Query.GraphMatch(n3Reader);
    77         if (memStore == null) {
     79        if (cachedStore == null) {
    7880          CacheStore();
    7981        }
    80         matcher.Run(memStore, resultSink);
     82        matcher.Run(cachedStore, resultSink);
    8183        return resultSink.Bindings.Skip(page * pageSize).Take(pageSize).ToList();
    8284      }
    8385    }
    8486
    85     SemWeb.Store memStore;
    8687    private void CacheStore() {
    87       memStore = new SemWeb.MemoryStore();
    88       memStore.Import(store);
     88      cachedStore = new SemWeb.MemoryStore();
     89      cachedStore.Import(store);
    8990    }
    9091
     
    9293      lock (bigLock) {
    9394        MyQueryResultSink resultSink = new MyQueryResultSink();
    94         if (memStore == null) {
     95        if (cachedStore == null) {
    9596          CacheStore();
    9697        }
    97         Translate(query).Run(memStore, resultSink);
     98        Translate(query).Run(cachedStore, resultSink);
    9899        return resultSink.Bindings.Skip(page * pageSize).Take(pageSize).ToList();
    99100      }
Note: See TracChangeset for help on using the changeset viewer.