[Groonga-commit] groonga/express-kotoumi [master] Reduce indent level

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Dec 28 17:26:10 JST 2012


YUKI Hiroshi	2012-12-28 17:26:10 +0900 (Fri, 28 Dec 2012)

  New Revision: baafab77f5b8b66b9d7fee078015d6477d3efb1a
  https://github.com/groonga/express-kotoumi/commit/baafab77f5b8b66b9d7fee078015d6477d3efb1a

  Log:
    Reduce indent level

  Modified files:
    lib/backend-adaptor.js

  Modified: lib/backend-adaptor.js (+33 -33)
===================================================================
--- lib/backend-adaptor.js    2012-12-28 17:25:19 +0900 (cf5ed0c)
+++ lib/backend-adaptor.js    2012-12-28 17:26:10 +0900 (f5266a4)
@@ -11,37 +11,37 @@ function Connection(params) {
 Connection.prototype = new EventEmitter();
 
 Connection.prototype._init = function() {
-    this._callbacks = {};
-
-    this._sender = (
-      this._params.sender ||
-      fluent.createFluentSender(this._params.tag,
-                                { host: this._params.host,
-                                  port: this._params.port })
-    );
-    this._server = http.createServer(this._handleHttpRequest.bind(this));
-    this._socket = socketIo.listen(this._server);
-
-    var self = this;
-    this._socket.sockets.on('connection', function(socket) {
-      socket.on(self._params.tag + '.result',
-                self._handleResult.bind(self));
-    });
-    this._socket.set('log level', 1);
+  this._callbacks = {};
+
+  this._sender = (
+    this._params.sender ||
+    fluent.createFluentSender(this._params.tag,
+                              { host: this._params.host,
+                                port: this._params.port })
+  );
+  this._server = http.createServer(this._handleHttpRequest.bind(this));
+  this._socket = socketIo.listen(this._server);
+
+  var self = this;
+  this._socket.sockets.on('connection', function(socket) {
+    socket.on(self._params.tag + '.result',
+              self._handleResult.bind(self));
+  });
+  this._socket.set('log level', 1);
 };
 
 Connection.prototype._handleHttpRequest = function(request, response) {
 };
 
 Connection.prototype._handleResult = function(data) {
-    var id = data['query']['requestid']
-    var callbck = this._callbacks[id];
-    if (callback) {
-      delete this._callbacks[id];
-      callback(data['result']);
-    } else {
-      // something went wrong;
-    }
+  var id = data['query']['requestid']
+  var callbck = this._callbacks[id];
+  if (callback) {
+    delete this._callbacks[id];
+    callback(data['result']);
+  } else {
+    // something went wrong;
+  }
 };
 
 function createId() {
@@ -49,14 +49,14 @@ function createId() {
 }
 
 Connection.prototype.emitMessage = function(message, callback) {
-    var id = createId();
-    var message = {
-      requestid: id,
-      command:   'search',
-      query:     query
-    };
-    this._callbacks[id] = callback;
-    this._sender.emit('query', message);
+  var id = createId();
+  var message = {
+    requestid: id,
+    command:   'search',
+    query:     query
+  };
+  this._callbacks[id] = callback;
+  this._sender.emit('query', message);
 };
 
 export.Connection = Connection;
-------------- next part --------------
HTML����������������������������...
Télécharger 



More information about the Groonga-commit mailing list
Back to archive index