• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Révisionde8b542bdf9598e3e464e2cfdb9549be8dbca6a5 (tree)
l'heure2014-12-01 18:13:56
Auteurkomutan <t_komuta@nift...>
Commiterkomutan

Message de Log

微修正

Change Summary

Modification

--- a/src/LibNMeCabMMF/Extension/MeCabNodeExtension.cs
+++ b/src/LibNMeCabMMF/Extension/MeCabNodeExtension.cs
@@ -95,25 +95,22 @@ namespace NMeCab.Extension
9595 private unsafe static string GetCsvElement(char* csvRow, int rowLength, int index)
9696 {
9797 char* end = csvRow + rowLength;
98+ int count = 0;
99+ int len = 0;
98100
99- for (int i = 0; i < index; i++)
101+ while (csvRow != end)
100102 {
101- while (*csvRow != ',')
103+ if (*csvRow == ',')
102104 {
103- if (csvRow == end) return null;
104- csvRow++;
105+ if (count == index) return new string(csvRow - len, 0, len);
106+ count++;
107+ len = 0;
105108 }
106- csvRow++;
107- }
108-
109- int len = 0;
110- while (csvRow != end && *csvRow != ',')
111- {
112109 len++;
113110 csvRow++;
114111 }
115112
116- return new string(csvRow - len, 0, len);
113+ return count == index ? new string(csvRow - len, 0, len) : null;
117114 }
118115 }
119116 }