From 0ff372a63e18d7433d2f63100eafa34d1ecdccb6 Mon Sep 17 00:00:00 2001 From: John Colvin Date: Fri, 31 Oct 2025 13:40:40 -0400 Subject: [PATCH] refactor: Add default impl for columnInfo indexers in IBlueTableSchema --- .../DataStreamCore/BlueData/IBlueTableSchema.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/DataStreamSuite/DataStreamCore/BlueData/IBlueTableSchema.cs b/src/DataStreamSuite/DataStreamCore/BlueData/IBlueTableSchema.cs index 9f279dc9f..455beaf35 100644 --- a/src/DataStreamSuite/DataStreamCore/BlueData/IBlueTableSchema.cs +++ b/src/DataStreamSuite/DataStreamCore/BlueData/IBlueTableSchema.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections; +using System.Collections.Generic; namespace BCG { @@ -12,11 +11,21 @@ namespace BCG /// /// index w.r.t. the ordinal /// - ColumnInfo this[int index]{get;} + ColumnInfo this[int index] => columnInfo[index]; /// /// index w.r.t. column name /// - ColumnInfo this[string colName]{get;} + ColumnInfo this[string colName] { + get { + var colInfos = columnInfo; + for (int i = 0; i < colInfos.Length; i++) { + if (colInfos[i].colName == colName) { + return colInfos[i]; + } + } + throw new KeyNotFoundException(); + } + } /// /// Utility method to get all the column names ///