ReSharper conform to 'var' settings

This commit is contained in:
Erwin de Haan
2019-01-13 21:37:13 +01:00
parent a36658f6f0
commit 65bd052f3e
199 changed files with 1063 additions and 1063 deletions
@@ -132,7 +132,7 @@ namespace Priority_Queue
int parent = node.QueueIndex / 2;
while (parent >= 1)
{
TItem parentNode = _nodes[parent];
var parentNode = _nodes[parent];
if (HasHigherPriority(parentNode, node))
break;
@@ -163,7 +163,7 @@ namespace Priority_Queue
break;
}
TItem childLeft = _nodes[childLeftIndex];
var childLeft = _nodes[childLeftIndex];
if (HasHigherPriority(childLeft, newParent))
{
newParent = childLeft;
@@ -173,7 +173,7 @@ namespace Priority_Queue
int childRightIndex = childLeftIndex + 1;
if (childRightIndex <= _numNodes)
{
TItem childRight = _nodes[childRightIndex];
var childRight = _nodes[childRightIndex];
if (HasHigherPriority(childRight, newParent))
{
newParent = childRight;
@@ -234,7 +234,7 @@ namespace Priority_Queue
}
#endif
TItem returnMe = _nodes[1];
var returnMe = _nodes[1];
Remove(returnMe);
item = returnMe;
return true;
@@ -316,7 +316,7 @@ namespace Priority_Queue
{
//Bubble the updated node up or down as appropriate
int parentIndex = node.QueueIndex / 2;
TItem parentNode = _nodes[parentIndex];
var parentNode = _nodes[parentIndex];
if (parentIndex > 0 && HasHigherPriority(node, parentNode))
{
@@ -356,7 +356,7 @@ namespace Priority_Queue
}
//Swap the node with the last node
TItem formerLastNode = _nodes[_numNodes];
var formerLastNode = _nodes[_numNodes];
Swap(node, formerLastNode);
_nodes[_numNodes] = null;
_numNodes--;
+5 -5
View File
@@ -63,7 +63,7 @@ namespace MediaBrowser.Providers.Manager
/// <param name="imageIndex">Index of the image.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
/// <exception cref="System.ArgumentNullException">mimeType</exception>
/// <exception cref="ArgumentNullException">mimeType</exception>
public Task SaveImage(BaseItem item, Stream source, string mimeType, ImageType type, int? imageIndex, CancellationToken cancellationToken)
{
return SaveImage(item, source, mimeType, type, imageIndex, null, cancellationToken);
@@ -299,7 +299,7 @@ namespace MediaBrowser.Providers.Manager
/// <param name="type">The type.</param>
/// <param name="imageIndex">Index of the image.</param>
/// <returns>System.String.</returns>
/// <exception cref="System.ArgumentNullException">
/// <exception cref="ArgumentNullException">
/// imageIndex
/// or
/// imageIndex
@@ -316,7 +316,7 @@ namespace MediaBrowser.Providers.Manager
/// <param name="type">The type.</param>
/// <param name="imageIndex">Index of the image.</param>
/// <param name="path">The path.</param>
/// <exception cref="System.ArgumentNullException">imageIndex
/// <exception cref="ArgumentNullException">imageIndex
/// or
/// imageIndex</exception>
private void SetImagePath(BaseItem item, ImageType type, int? imageIndex, string path)
@@ -333,7 +333,7 @@ namespace MediaBrowser.Providers.Manager
/// <param name="mimeType">Type of the MIME.</param>
/// <param name="saveLocally">if set to <c>true</c> [save locally].</param>
/// <returns>System.String.</returns>
/// <exception cref="System.ArgumentNullException">
/// <exception cref="ArgumentNullException">
/// imageIndex
/// or
/// imageIndex
@@ -490,7 +490,7 @@ namespace MediaBrowser.Providers.Manager
/// <param name="imageIndex">Index of the image.</param>
/// <param name="mimeType">Type of the MIME.</param>
/// <returns>IEnumerable{System.String}.</returns>
/// <exception cref="System.ArgumentNullException">imageIndex</exception>
/// <exception cref="ArgumentNullException">imageIndex</exception>
private string[] GetCompatibleSavePaths(BaseItem item, ImageType type, int? imageIndex, string mimeType)
{
var season = item as Season;
@@ -415,7 +415,7 @@ namespace MediaBrowser.Providers.Manager
var folder = item as Folder;
if (folder != null && folder.SupportsDateLastMediaAdded)
{
DateTime dateLastMediaAdded = DateTime.MinValue;
var dateLastMediaAdded = DateTime.MinValue;
var any = false;
foreach (var child in children)
@@ -80,7 +80,7 @@ namespace Priority_Queue
throw new InvalidOperationException("Cannot call .First on an empty queue");
}
SimpleNode first = _queue.First;
var first = _queue.First;
return (first != null ? first.Data : default(TItem));
}
}
@@ -155,7 +155,7 @@ namespace Priority_Queue
{
lock (_queue)
{
SimpleNode node = new SimpleNode(item);
var node = new SimpleNode(item);
if (_queue.Count == _queue.MaxSize)
{
_queue.Resize(_queue.MaxSize * 2 + 1);
@@ -199,7 +199,7 @@ namespace Priority_Queue
{
try
{
SimpleNode updateMe = GetExistingNode(item);
var updateMe = GetExistingNode(item);
_queue.UpdatePriority(updateMe, priority);
}
catch (InvalidOperationException ex)
@@ -211,7 +211,7 @@ namespace Priority_Queue
public IEnumerator<TItem> GetEnumerator()
{
List<TItem> queueData = new List<TItem>();
var queueData = new List<TItem>();
lock (_queue)
{
//Copy to a separate list because we don't want to 'yield return' inside a lock