New answers tagged

2

Answers to your questions Which version is preferable? The latter has less dependencies, but the former has no raw loops... If having less dependencies matters, then go for the raw loops. If not, then I don't think it matters much; the lambda in the first version makes it just as verbose as the second version, and they should be functionally identical. Is ...


2

Welcome to Code Review, the use of <T extends Comparable<T>> and T[] looks fine to me and personally I would not change it. The only one thing I am not agree is about the indexes you use to order one array like below : Quicksort.sort(stringList, 0, stringList.length - 1); In the java sorting methods from the std library the range to be sorted ...


0

I've found this to work well: if (valueType == typeof(int)) field.Value =(int) Convert.ChangeType(reader.Value, valueType); else field.Value = (dynamic)Convert.ChangeType(reader.Value, valueType); you have to be explicit with int, but all other primitive types work fine for me.


Top 50 recent answers are included