Support .Net framework 2.0 (#1062)
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SherpaOnnx
|
||||
@@ -29,7 +28,14 @@ namespace SherpaOnnx
|
||||
// The caller should ensure all passed streams are ready for decoding.
|
||||
public void Decode(IEnumerable<OfflineStream> streams)
|
||||
{
|
||||
IntPtr[] ptrs = streams.Select(s => s.Handle).ToArray();
|
||||
// TargetFramework=net20 does not support System.Linq
|
||||
// IntPtr[] ptrs = streams.Select(s => s.Handle).ToArray();
|
||||
List<IntPtr> list = new List<IntPtr>();
|
||||
foreach (OfflineStream s in streams)
|
||||
{
|
||||
list.Add(s.Handle);
|
||||
}
|
||||
IntPtr[] ptrs = list.ToArray();
|
||||
Decode(_handle.Handle, ptrs, ptrs.Length);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user