Skip to content

Commit

Permalink
more consistent facade for merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Modest-as committed May 28, 2021
1 parent fb44efe commit b4bf895
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Docnet.Core/DocLib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public byte[] Merge(byte[] fileOne, byte[] fileTwo)
}

/// <inheritdoc />
public byte[] Merge(IList<byte[]> files)
public byte[] Merge(IReadOnlyList<byte[]> files)
{
Validator.CheckCollectionNotEmpty(files, nameof(files));

Expand Down
3 changes: 1 addition & 2 deletions src/Docnet.Core/Editors/DocEditor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.IO;
using Docnet.Core.Bindings;
Expand Down Expand Up @@ -32,7 +31,7 @@ public byte[] Merge(byte[] fileOne, byte[] fileTwo)
}
}

public byte[] Merge(IList<byte[]> files)
public byte[] Merge(IReadOnlyList<byte[]> files)
{
lock (DocLib.Lock)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Docnet.Core/Editors/IDocEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ internal interface IDocEditor

byte[] Merge(byte[] fileOne, byte[] fileTwo);

byte[] Merge(IList<byte[]> files);
byte[] Merge(IReadOnlyList<byte[]> files);

byte[] Split(string filePath, int pageFromIndex, int pageToIndex);

Expand Down
2 changes: 1 addition & 1 deletion src/Docnet.Core/IDocLib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public interface IDocLib : IDisposable
/// </summary>
/// <param name="files">Files to merge to fileOne.</param>
/// <returns>New file bytes.</returns>
byte[] Merge(IList<byte[]> files);
byte[] Merge(IReadOnlyList<byte[]> files);

/// <summary>
/// Split a range of pages into a separate document.
Expand Down
2 changes: 1 addition & 1 deletion src/Docnet.Core/Validation/Validator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Docnet.Core.Validation
{
internal static class Validator
{
public static void CheckCollectionNotEmpty<T>(ICollection<T> enumerable, string name)
public static void CheckCollectionNotEmpty<T>(IReadOnlyList<T> enumerable, string name)
{
if (enumerable.Count <= 0)
{
Expand Down

0 comments on commit b4bf895

Please sign in to comment.