Skip to content

Commit

Permalink
- fix for bug in svn 6669
Browse files Browse the repository at this point in the history
- cleanup

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6670 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Feb 15, 2010
1 parent d378ca4 commit 2bc36de
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 55 deletions.
8 changes: 5 additions & 3 deletions source/de/anomic/yacy/yacySeedDB.java
Expand Up @@ -532,11 +532,13 @@ private yacySeed get(final String hash, final MapDataMining database) {
if ((this.mySeed != null) && (hash.equals(mySeed.hash))) return mySeed;
ConcurrentHashMap<String, String> entry = new ConcurrentHashMap<String, String>();
try {
entry.putAll(database.get(hash));
Map<String, String> map = database.get(hash);
if (map == null) return null;
entry.putAll(map);
} catch (final IOException e) {
entry = null;
Log.logException(e);
return null;
}
if (entry == null) return null;
return new yacySeed(hash, entry);
}

Expand Down
16 changes: 0 additions & 16 deletions source/net/yacy/kelondro/blob/HeapReader.java
Expand Up @@ -602,22 +602,6 @@ private Map.Entry<byte[], byte[]> next0() {
}
}

/* the old code:
private Map.Entry<byte[], byte[]> next0() {
try {
while (true) {
int len = is.readInt();
byte[] key = new byte[this.keylen];
if (is.read(key) < key.length) return null;
byte[] payload = new byte[len - this.keylen];
if (is.read(payload) < payload.length) return null;
if (key[0] == 0) continue; // this is an empty gap
return new entry(key, payload);
}
}
*/

public Map.Entry<byte[], byte[]> next() {
final Map.Entry<byte[], byte[]> n = this.nextEntry;
this.nextEntry = next0();
Expand Down
6 changes: 0 additions & 6 deletions source/net/yacy/kelondro/blob/MapDataMining.java
Expand Up @@ -191,18 +191,12 @@ public synchronized void put(final String key, final Map<String, String> newMap)
assert (key != null);
assert (key.length() > 0);
assert (newMap != null);

// super.put(key, newMap); // moved down for solving yacy-bar-values - needed to be before the other stuff?
//
// // update sortCluster
// if (sortClusterMap != null) updateSortCluster(key, newMap);

// update elementCount
if ((longaccfields != null) || (doubleaccfields != null)) {
final Map<String, String> oldMap = super.get(key, false);
if (oldMap != null) {
// element exists, update acc
// if ((longaccfields != null) || (doubleaccfields != null)) updateAcc(oldMap, false); // we already checked this - don't we?
updateAcc(oldMap, false);
}

Expand Down
30 changes: 0 additions & 30 deletions source/net/yacy/kelondro/util/BDecoder.java
Expand Up @@ -307,36 +307,6 @@ public BObject parse() {
return null;
}
}
/*
public static BObject parse(InputStream is) {
if (is.available() < 1) return null;
char ch = (char) is.read();
if ((ch >= '0') && (ch <= '9')) {
StringBuilder s = new StringBuilder();
s.append(ch);
while ((ch = (char) is.read()) != ':') s.append(ch);
int len = Integer.parseInt(s.toString());
byte[] b = new byte[len];
is.read(b);
return new BStringObject(new String(b));
} else if (ch == 'l') {
pos++;
return new BListObject(readList());
} else if (ch == 'd') {
pos++;
return new BDictionaryObject(convertToMap(readList()));
} else if (ch == 'i') {
pos++;
int end = pos;
while (b[end] != 'e') ++end;
BIntegerObject io = new BIntegerObject(Long.parseLong(new String(b, pos, end - pos)));
pos = end + 1;
return io;
} else {
return null;
}
}
*/

public static void print(BObject bo, int t) {
for (int i = 0; i < t; i++) System.out.print(" ");
Expand Down

0 comments on commit 2bc36de

Please sign in to comment.