Slight refactoring in shallerdbprocessor

main
Inga 🏳‍🌈 15 years ago
parent e80cb83025
commit e18621fafa
  1. 6
      ImportConsole/ShallerDBProcessor.cs

@ -147,7 +147,7 @@ namespace FLocal.ImportConsole {
private readonly static DateTime UNIX = new DateTime(1970, 1, 1, 0, 0, 0); private readonly static DateTime UNIX = new DateTime(1970, 1, 1, 0, 0, 0);
public static void processDB(string filename) { public static void processDB(string filename) {
List<KeyValuePair<int, Action>> inserts = new List<KeyValuePair<int, Action>>(); Dictionary<int, Action> inserts = new Dictionary<int, Action>();
HashSet<int> discussionsIds = new HashSet<int>(); HashSet<int> discussionsIds = new HashSet<int>();
using(StreamReader reader = new StreamReader(filename)) { using(StreamReader reader = new StreamReader(filename)) {
int i=0; int i=0;
@ -207,7 +207,7 @@ namespace FLocal.ImportConsole {
if(data.ContainsKey("Layer")) { if(data.ContainsKey("Layer")) {
layer = PostLayer.LoadById(int.Parse(data["Layer"])); layer = PostLayer.LoadById(int.Parse(data["Layer"]));
} }
inserts.Add(new KeyValuePair<int, Action>(postId, () => { inserts[postId] = () => {
if(postId == main || postId == localMain) { if(postId == main || postId == localMain) {
//first post in the thread //first post in the thread
string legacyBoardName; string legacyBoardName;
@ -240,7 +240,7 @@ namespace FLocal.ImportConsole {
} }
post.Reply(user, title, body, layer, date, postId); post.Reply(user, title, body, layer, date, postId);
} }
})); };
Console.Write("+"); Console.Write("+");
} }
} catch(Exception e) { } catch(Exception e) {

Loading…
Cancel
Save