Removing redundant code

Removing redundant code

--- Core/Theraot/Core/StringHelper.cs
+++ Core/Theraot/Core/StringHelper.cs
@@ -8,7 +8,7 @@

 namespace Theraot.Core
 {
-    [global::System.Diagnostics.DebuggerNonUserCode]
+    [System.Diagnostics.DebuggerNonUserCode]
     public static partial class StringHelper
     {
         public static string Append(this string text, string value)
@@ -408,15 +408,12 @@
             {
                 return Concat(values);
             }
-            else
-            {
-                var stringList = new List<string>();
-                foreach (var item in values)
-                {
-                    stringList.Add(item);
-                }
-                return ImplodeExtracted(separator, stringList.ToArray(), 0, stringList.Count);
-            }
+            var stringList = new List<string>();
+            foreach (var item in values)
+            {
+                stringList.Add(item);
+            }
+            return ImplodeExtracted(separator, stringList.ToArray(), 0, stringList.Count);
         }

         public static string Implode<T>(string separator, IEnumerable<T> values)
@@ -429,15 +426,12 @@
             {
                 return Concat(values);
             }
-            else
-            {
-                var stringList = new List<string>();
-                foreach (var item in values)
-                {
-                    stringList.Add(item.ToString());
-                }
-                return ImplodeExtracted(separator, stringList.ToArray(), 0, stringList.Count);
-            }
+            var stringList = new List<string>();
+            foreach (var item in values)
+            {
+                stringList.Add(item.ToString());
+            }
+            return ImplodeExtracted(separator, stringList.ToArray(), 0, stringList.Count);
         }

         public static string Implode<T>(string separator, IEnumerable<T> values, Converter<T, string> converter)
@@ -454,15 +448,12 @@
             {
                 return Concat(values, converter);
             }
-            else
-            {
-                var stringList = new List<string>();
-                foreach (var item in values)
-                {
-                    stringList.Add(item.ToString());
-                }
-                return ImplodeExtracted(separator, stringList.ToArray(), 0, stringList.Count);
-            }
+            var stringList = new List<string>();
+            foreach (var item in values)
+            {
+                stringList.Add(item.ToString());
+            }
+            return ImplodeExtracted(separator, stringList.ToArray(), 0, stringList.Count);
         }

         public static string Implode(string separator, IEnumerable<string> values, string start, string end)
@@ -475,30 +466,24 @@
             {
                 return Concat(values);
             }
-            else
-            {
-                var stringList = new List<string>();
-                foreach (var item in values)
-                {
-                    stringList.Add(item);
-                }
-                if (stringList.Count > 0)
-                {
-                    if (start == null)
-                    {
-                        start = string.Empty;
-                    }
-                    if (end == null)
-                    {
-                        end = string.Empty;
-                    }
-                    return start + ImplodeExtracted(separator, stringList.ToArray(), 0, stringList.Count) + end;
-                }
-                else
-                {
-                    return string.Empty;
-                }
-            }
+            var stringList = new List<string>();
+            foreach (var item in values)
+            {
+                stringList.Add(item);
+            }
+            if (stringList.Count > 0)
+            {
+                if (start == null)
+                {
+                    start = string.Empty;
+                }
+                if (end == null)
+                {
+                    end = string.Empty;
+                }
+                return start + ImplodeExtracted(separator, stringList.ToArray(), 0, stringList.Count) + end;
+            }
+            return string.Empty;
         }

         public static string Implode<T>(string separator, IEnumerable<T> values, string start, string end)
@@ -511,30 +496,24 @@
             {
                 return Concat(values);
             }
-            else
-            {
-                var stringList = new List<string>();
-                foreach (var item in values)
-                {
-                    stringList.Add(item.ToString());
-                }
-                if (stringList.Count > 0)
-                {
-                    if (start == null)
-                    {
-                        start = string.Empty;
-                    }
-                    if (end == null)
-                    {
-                        end = string.Empty;
-                    }
-                    return start + ImplodeExtracted(separator, stringList.ToArray(), 0, stringList.Count) + end;
-                }
-                else
-                {
-                    return string.Empty;
-                }
-            }
+            var stringList = new List<string>();
+            foreach (var item in values)
+            {
+                stringList.Add(item.ToString());
+            }
+            if (stringList.Count > 0)
+            {
+                if (start == null)
+                {
+                    start = string.Empty;
+                }
+                if (end == null)
+                {
+                    end = string.Empty;
+                }
+                return start + ImplodeExtracted(separator, stringList.ToArray(), 0, stringList.Count) + end;
+            }
+            return string.Empty;
         }

         public static string Implode<T>(string separator, IEnumerable<T> values, Converter<T, string> converter, string start, string end)
@@ -551,30 +530,24 @@
             {
                 return Concat(values, converter);
             }
-            else
-            {
-                var stringList = new List<string>();
-                foreach (var item in values)
-                {
-                    stringList.Add(item.ToString());
-                }
-                if (stringList.Count > 0)
-                {
-                    if (start == null)
-                    {
-                        start = string.Empty;
-                    }
-                    if (end == null)
-                    {
-                        end = string.Empty;
-                    }
-                    return start + ImplodeExtracted(separator, stringList.ToArray(), 0, stringList.Count) + end;
-                }
-                else
-                {
-                    return string.Empty;
-                }
-            }
+            var stringList = new List<string>();
+            foreach (var item in values)
+            {
+                stringList.Add(item.ToString());
+            }
+            if (stringList.Count > 0)
+            {
+                if (start == null)
+                {
+                    start = string.Empty;
+                }
+                if (end == null)
+                {
+                    end = string.Empty;
+                }
+                return start + ImplodeExtracted(separator, stringList.ToArray(), 0, stringList.Count) + end;
+            }
+            return string.Empty;
         }

         public static bool Like(this string text, Regex regex, int startAt)
@@ -831,10 +804,7 @@
             {
                 return string.Empty;
             }
-            else
-            {
-                return text;
-            }
+            return text;
         }

         public static string Start(this string text, int characterCount)
@@ -890,16 +860,13 @@
             {
                 return string.Empty;
             }
-            else
-            {
-                var result = new StringBuilder(length);
-                for (int index = startIndex; index < maxIndex; index++)
-                {
-                    var item = array[index];
-                    result.Append(item);
-                }
-                return result.ToString();
-            }
+            var result = new StringBuilder(length);
+            for (int index = startIndex; index < maxIndex; index++)
+            {
+                var item = array[index];
+                result.Append(item);
+            }
+            return result.ToString();
         }

         private static string ImplodeExtracted(string separator, object[] array, int startIndex, int count)
@@ -943,25 +910,22 @@
             {
                 return string.Empty;
             }
-            else
-            {
-                var result = new StringBuilder(length);
-                bool first = true;
-                for (int index = startIndex; index < maxIndex; index++)
-                {
-                    var item = array[index];
-                    if (first)
-                    {
-                        first = false;
-                    }
-                    else
-                    {
-                        result.Append(separator);
-                    }
-                    result.Append(item);
-                }
-                return result.ToString();
-            }
+            var result = new StringBuilder(length);
+            bool first = true;
+            for (int index = startIndex; index < maxIndex; index++)
+            {
+                var item = array[index];
+                if (first)
+                {
+                    first = false;
+                }
+                else
+                {
+                    result.Append(separator);
+                }
+                result.Append(item);
+            }
+            return result.ToString();
         }
     }


Pass the permutation as a ReadOnlySpan<>

--- Countdown/Models/SolvingEngine.cs
+++ Countdown/Models/SolvingEngine.cs
@@ -125,7 +125,7 @@
         /// <param name="permutation">the current tile permutation</param>
         /// <param name="permutationIndex">position in the permutation</param>
         /// <param name="depth">recursion depth</param>
-        private void SolveRecursive(int stackHead, List<int> mapEntry, int mapIndex, int[] permutation, int permutationIndex, int depth)
+        private void SolveRecursive(int stackHead, List<int> mapEntry, int mapIndex, ReadOnlySpan<int> permutation, int permutationIndex, int depth)
         {
             const int cInvalidResult = 0;

@@ -250,7 +250,7 @@
         /// <param name="mapEntry"></param>
         /// <param name="permutation"></param>
         /// <returns></returns>
-        private string ConvertToString(List<int> mapEntry, int[] permutation)
+        private string ConvertToString(List<int> mapEntry, ReadOnlySpan<int> permutation)
         {
             int mapIndex = 0;
             int operatorCount = 0;
@@ -289,7 +289,7 @@
         /// <summary>
         /// starts the solving engine for the given permutation
         /// </summary>
-        public void Solve(int[] permutation)
+        public void Solve(ReadOnlySpan<int> permutation)
         {
             foreach (List<int> mapEntry in map)
                 SolveRecursive(-1, mapEntry, 0, permutation, 0, 0);


Added flags to show whether bookmarks are filtered or not.

--- CryPixivClient/MainWindow.xaml.cs
+++ CryPixivClient/MainWindow.xaml.cs
@@ -933,6 +933,7 @@
             MainCollectionViewBookmarks.Filter -= BookmarkFilter;
             filterTags = w.ToFilter;
             MainCollectionViewBookmarks.Filter += BookmarkFilter;
+            PublicBookmarksFilterActive = true;
         }
         void srchPrv_Click(object sender, RoutedEventArgs e)
         {
@@ -945,8 +946,11 @@
             MainCollectionViewBookmarksPrivate.Filter -= BookmarkFilterPrivate;
             filterTagsPrivate = w.ToFilter;
             MainCollectionViewBookmarksPrivate.Filter += BookmarkFilterPrivate;
-        }
-
+            PrivateBookmarksFilterActive = true;
+        }
+
+        static public bool PublicBookmarksFilterActive = false;
+        static public bool PrivateBookmarksFilterActive = false;
         static List<string> filterTags = new List<string>();
         static List<string> filterTagsPrivate = new List<string>();
         void BookmarkFilter(object sender, FilterEventArgs e)
@@ -966,8 +970,16 @@
             e.Accepted = accepted;
         }

-        void rmv_Click(object sender, RoutedEventArgs e) => MainCollectionViewBookmarks.Filter -= BookmarkFilter;
-
-        void rmvPrv_Click(object sender, RoutedEventArgs e) => MainCollectionViewBookmarksPrivate.Filter -= BookmarkFilterPrivate;
+        void rmv_Click(object sender, RoutedEventArgs e)
+        {
+            PublicBookmarksFilterActive = false;
+            MainCollectionViewBookmarks.Filter -= BookmarkFilter;
+        }
+
+        void rmvPrv_Click(object sender, RoutedEventArgs e)
+        {
+            PrivateBookmarksFilterActive = false;
+            MainCollectionViewBookmarksPrivate.Filter -= BookmarkFilterPrivate;
+        }
     }
 }


Text changed.

Text changed.

--- CryPixivClient/MainWindow.xaml.cs
+++ CryPixivClient/MainWindow.xaml.cs
@@ -590,7 +590,7 @@
                 HorizontalAlignment = HorizontalAlignment.Left,
                 Margin = new Thickness(20, 18, 0, 0),
                 TextWrapping = TextWrapping.Wrap,
-                Text = "Your search history will be displayed here",
+                Text = "Search History",
                 VerticalAlignment = VerticalAlignment.Top,
                 Foreground = System.Windows.Media.Brushes.Gray
             };


fix bug with getting last page of query

fix bug with getting last page of query

--- DynamoDB/Contexts/QueryContext.cs
+++ DynamoDB/Contexts/QueryContext.cs
@@ -358,7 +358,7 @@
 				items.AddRange(lastResponse.Items.Select(item => item.ToMap()));
 			} while(!IsComplete(lastResponse));
 			var lastEvaluatedKey = lastResponse.LastEvaluatedKey;
-			return new ItemPage(items, lastEvaluatedKey != null ? lastEvaluatedKey.ToItemKey(keySchema) : default(ItemKey?));
+			return new ItemPage(items, !IsComplete(lastResponse) ? lastEvaluatedKey.ToItemKey(keySchema) : default(ItemKey?));
 		}
 		private IEnumerable<DynamoDBMap> Query(Dictionary<string, Aws.Condition> keyConditions)
 		{
@@ -386,7 +386,7 @@
 				items.AddRange(lastResponse.Items.Select(item => item.ToMap()));
 			} while(!IsComplete(lastResponse));
 			var lastEvaluatedKey = lastResponse.LastEvaluatedKey;
-			return new ItemPage(items, lastEvaluatedKey != null ? lastEvaluatedKey.ToItemKey(keySchema) : default(ItemKey?));
+			return new ItemPage(items, !IsComplete(lastResponse) ? lastEvaluatedKey.ToItemKey(keySchema) : default(ItemKey?));
 		}
 		private Aws.QueryRequest BuildQueryRequest(Dictionary<string, Aws.Condition> keyConditions)
 		{


Target dependecy help

Target dependecy help

--- FlubuCore/Targeting/TargetTree.cs
+++ FlubuCore/Targeting/TargetTree.cs
@@ -195,7 +195,20 @@
             }

             Target target = _targets[targetName] as Target;
+
             target.TargetHelp(taskContext);
+
+            if (target.Dependencies.Count > 0)
+            {
+                taskContext.LogInfo(" ");
+                taskContext.LogInfo($"Target {targetName}  dependencies: ");
+                foreach (var targetDependencyName in target.Dependencies)
+                {
+                    taskContext.LogInfo("------------------------------------");
+                    var targetDependecy = _targets[targetDependencyName.Key] as Target;
+                    targetDependecy?.TargetHelp(taskContext);
+                }
+            }
         }

         public void SetDefaultTarget(ITarget target)


Fixing class documentation text

Fixing class documentation text

--- Fluent.Ribbon/IHeaderedControl.cs
+++ Fluent.Ribbon/IHeaderedControl.cs
@@ -1,12 +1,12 @@
 namespace Fluent
 {
     /// <summary>
-    /// Represents control that has a header
+    /// Represents a control that has a header.
     /// </summary>
     public interface IHeaderedControl
     {
         /// <summary>
-        /// Gets or sets element Text
+        /// Gets or sets the header.
         /// </summary>
         object Header { get; set; }
     }