Make it so the filter does not iterate over already filtered IPs.

This commit is contained in:
2024-11-29 19:13:27 +01:00
parent 407bbc1556
commit 2cff817044
5 changed files with 16 additions and 46 deletions
+7 -7
View File
@@ -48,7 +48,7 @@ public class DbHandler
" VALUES (@threadNumber, @startRange, @endRange, @firstByte, @secondByte, @thirdByte, @fourthByte);";
private const string ReadUnfilteredStatement = "SELECT * FROM Unfiltered WHERE Id = @id;";
private const string ReadUnfilteredIdsStatement = "SELECT Id FROM Unfiltered WHERE Id != 0 ORDER BY Id DESC LIMIT 1;";
private const string ReadUnfilteredIdsStatement = "SELECT Id FROM Unfiltered WHERE Filtered == 0;";
private const string ReadFilteredStatement = "SELECT Title2, Url2 FROM Filtered WHERE (Url2 NOT NULL AND Url2 != '') AND (Title2 NOT NULL AND Title2 != '') ORDER BY Url2 DESC;";
private const string ReadFilteredIdsStatement = "SELECT Id FROM Filtered WHERE Id != 0 ORDER BY Id DESC LIMIT 1;";
private const string ReadFilteredIpStatement = "SELECT Ip1, Ip2, Ip3, Ip4 FROM Filtered WHERE Ip1 == @ip1 AND Ip2 == @ip1 AND Ip3 == @ip1 AND Ip4 == @ip1 ORDER BY Ip1 DESC LIMIT 1;";
@@ -372,10 +372,8 @@ public class DbHandler
return unfiltered;
}
public long GetUnfilteredIndexes()
public List<long> GetUnfilteredIndexes()
{
long rowId = 0;
using SqliteConnection connection = new(_unfilteredConnectionString);
connection.Open();
@@ -384,15 +382,17 @@ public class DbHandler
if (!reader.HasRows)
{
return 0;
return [];
}
List<long> ids = [];
while (reader.Read())
{
rowId = reader.GetInt64(0);
ids.Add(reader.GetInt64(0));
}
return rowId;
return ids;
}
public long GetFilteredIndexes()
-3
View File
@@ -1,3 +0,0 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=models_005Cbackend/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=models_005Cinternal/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>